Jul 09 2021 08:18 AM
I'm trying to use a Name, containing UNIQUE formula in Data Validation, but it throughs an error: The Source Currently Evaluates To an Error.
Is it a bug?
Jul 09 2021 09:08 AM
I'm not sure, but if UNIQUE doesn't recognize the numbers then there will be an error like this,
as far as I can dare remember.
It could be that there are numbers in one column
and numbers are entered as text in the other column.
Hope this tip can help you.
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.
Jul 09 2021 09:41 AM
Jul 09 2021 12:00 PM
SolutionThat's by design. UNIQUE() function returns an array, and data validation doesn't work wit arrays. It works with references on ranges. Thus you need to land returned by UNIQUE() array into the range and use reference on this range. For example, if in A1 is =UNIQUE(something) in data validation you could use the list with reference on spill =$A$1#
Jul 12 2021 12:48 AM
@SergeiBaklan yes I did such a way with several helper sheets having TRANSPOSE(UNIQUE) and =$A$1#. It works, but bit slowly. Hoped there could be more elegant solution.
Oct 03 2022 02:40 PM
Sep 06 2023 01:19 PM
OFFSET/INDIRECT is even more slower. Didn't test the performance, but I guess significantly, depends on concrete data.
Fortunately in modern Excel we may not care about UNIQUE, it removes duplicates by default.
Dec 07 2023 11:10 AM
@SergeiBaklan
This only appears to be correct when refencing the cells directly, when attempting to reference a table (thus requiring use of INDIRECT) it provides all values, to include duplicated content.
Jul 09 2021 12:00 PM
SolutionThat's by design. UNIQUE() function returns an array, and data validation doesn't work wit arrays. It works with references on ranges. Thus you need to land returned by UNIQUE() array into the range and use reference on this range. For example, if in A1 is =UNIQUE(something) in data validation you could use the list with reference on spill =$A$1#