Forum Discussion
Data validation using VSTACK with dynamic arrays
- Jan 30, 2023
S_Cubed You're not missing anything, but DV expects a range formula that returns a range. Dynamic array functions don't work. What you need to do is write the VSTACK formula, let's say in K1. Then, point the DV list to =K1#
That should work.
Since you have access to a version of Excel loaded with functions, you could write your dynamic arrays without OFFSET.
An example:
=LET(names,$A$1:$A$1000,nonblank,COUNTA(names),TAKE(names,nonblank))
TAKE/DROP are also usable inside of Data Validation.
Thanks for the example. It appears a bit more intuitive than the OFFSET approach. I'll give that a try.
How about this.....Dr. Excel Manager, Please create an additional VSTACK function named VSTACKR, perhaps, that returns a Range object.
- PeterBartholomew1Feb 05, 2023Silver Contributor
Conversely, is there any reason why data validation, like conditional formatting, should not accept Arrays? There is much in the way of strange legacy behaviours that MS prefer not to touch even though the need may be clear.
- S_CubedFeb 05, 2023Copper ContributorPeter,
I've been holding my breath for Visual Studio capabilities to replace VBA.- PeterBartholomew1Feb 05, 2023Silver Contributor
After retiring, I set out to learn Visual Basic and the .Net environment in anticipation of it replacing VBA. I got that totally wrong and would have been better off focussing on the Web technologies.
Now TypeScript appears to be the way forward is assume there is some room for Visual Studio. Unfortunately I think I would need business editions of 365 to be able to use PowerAutomate etc.