Forum Discussion
Tony2021
Dec 25, 2021Iron Contributor
Dynamic Unique List - 2 Columns
Hello, I can create a dynamic unique list with 1 column of data but what I need now is a dynamic unique list of data in 2 columns. I have an example formula in the attached file but it only work...
- Dec 26, 2021
Tony2021 Never tried that before but perhaps like in the attached file.
If this is not what you had in mind, I'd suggest you look into Power Query. Much more flexible and robust for these kind of tasks. At least in my humble opinion.
Tony2021
Dec 26, 2021Iron Contributor
Hello Riny, thats ingenious. I have a follow up though. In my "real" data set there are many columns between the columns I need for the array. How can I use 2 non contigous columns? Imagine that there is a column between columns A and B making the array to reference only column A and C. I tried to modify the array (with AND) but it didnt seem to work. I got a #value error. I hope that makes sense. Let me know if you have any questions.
PeterBartholomew1
Dec 26, 2021Silver Contributor
I rather liked Riny_van_Eekelen 's idea of applying a FILTER horizontally to allow the columns to be selected dynamically. If, on the other hand, the columns to be used are known ahead of time, the array to be filtered can be built using CHOOSE. For example
= UNIQUE(
CHOOSE({1,2,3},
Table1[Column1],
Table1[Column3],
Table1[Column5]
)
)Being a modern function UNIQUE works as well on arrays as it does ranges. Using an Excel Table and ignoring the possibility of blanks. Riny's formula reduces to
= UNIQUE(
FILTER(Table1,criterion)
)
- Tony2021Dec 27, 2021Iron ContributorWow. Peter that is amazing. I am learning new functions in excel. Thank you for the follow up. Both solutions work for me.