Dynamically listing all unique values in Column
Hello,
I'm building pivot tables and need to dynamically list all the unique values from a column.
On my "formulas" sheet (not data sheet) I have INDEX(DISTINCT({SAO Range 1}), 1)
This works, however, I have to manually put in the formulas down the rows like such:
INDEX(DISTINCT({SAO Range 1}), 1)
INDEX(DISTINCT({SAO Range 1}), 2)
INDEX(DISTINCT({SAO Range 1}), 3)
...etc
Currently there are 5 unique values from 50 entries (these are mo/yr btw), but the list WILL grow.
I've inserted this formula up to INDEX(DISTINCT({SAO Range 1}), 25) with everything beyond 5 resulting in the expected (#INVALID VALUE)
In Excel I can use the "Unique" function and it will auto list the uniques, however, many dynamically. Is there a way to do the same in SS?
Thanks for any help with this
Best Answers

The way I sort of workaround this is to create a helper "Row Number" column and populate X numbers of rows with 1X (so if I need 300 rows I just type in a few numbers and then drag so that it autoincrements).
Then in my Index formula for the index number I put [Row Number]@row. Then at least you have a column formula:
INDEX(DISTINCT({SAO Range 1}), [Row Number]@row)
Not exactly what you're looking for but I don't know of another way to do it more efficiently, personally.

@BrianDN  good point, I forgot to add that part! I do an iferror to get around that and my count works properly. =iferror(INDEX(DISTINCT({SAO Range 1}), [Row Number]@row), "")
The count will only grab populated rows and you won't get all those errors.
Answers

The way I sort of workaround this is to create a helper "Row Number" column and populate X numbers of rows with 1X (so if I need 300 rows I just type in a few numbers and then drag so that it autoincrements).
Then in my Index formula for the index number I put [Row Number]@row. Then at least you have a column formula:
INDEX(DISTINCT({SAO Range 1}), [Row Number]@row)
Not exactly what you're looking for but I don't know of another way to do it more efficiently, personally.

Thanks Eric,
Yeah, that would make it possible to drag the formula, but another issue I have is the Invalid Value error, which when I reference the uniques along with the sumif for their frequency, the dashboard shows the errors count along with the actual values.
Anyway, I will mark this as answered as it does help and I appreciate you taking the time to give me the tip.

@BrianDN  good point, I forgot to add that part! I do an iferror to get around that and my count works properly. =iferror(INDEX(DISTINCT({SAO Range 1}), [Row Number]@row), "")
The count will only grab populated rows and you won't get all those errors.

Hey @BrianDN
Eric provided the best workaround for the native smartsheet application. If your license has access to Smartsheet premier apps pivot app or datamesh, there are other possible solutions. If you could tolerate a copy row to the other sheet with the additional columns that would bring, this might also be a solution. And lastly, if you were only needing to display the data in a tabular format on a dashboard, you might be able to use a summarized report.

I'll play with it later today using both of your insights.
As of now how have to say I'm extremely impressed with the community here and the response rate
Help Article Resources
Categories
 All Categories
 14 Welcome to the Community
 10.8K Get Help
 65 Global Discussions
 69 Industry Talk
 385 Announcements
 3.5K Ideas & Feature Requests
 55 Brandfolder
 125 Just for fun
 50 Community Job Board
 464 Show & Tell
 40 Member Spotlight
 44 Power Your Process
 28 Sponsor X
 234 Events
 7.3K Forum Archives
Check out the Formula Handbook template!