Count Distinct is Clearly Incorrect.
I have a sheet with approximately 18,000 rows. One column is called "ID". I have a support column where I am trying to understand how many unique entries are in "ID" and I am using this formula:
=COUNT(DISTINCT(ID:ID))
It's returning a value of 1 (which is clearly not correct). The column is a text column. There are no special characters in the column at all.
Has anybody seen this? What am I missing?
Answers
-
Check to make sure that you don't have any #ERROR in the range you're calculating. I'm able to replicate your issue with it returning 1 with an #ERROR int eh range, but once I remove it, it counts up as it should.
Jason Tarpinian - Sevan Technology
Smartsheet Aligned Partner
-
Hi @Jason Tarpinian. I checked with CNTL-F for error and for # error and I also updated formula to =COUNT(DISTINCT(COLLECT([ID]:[ID], [ID]:[ID], AND(NOT(ISBLANK(@cell)), LEFT(@cell, 1) <> "#"))))
just in case that was tripping when there was a # at the beginning or there was a blank. No fix. Still showing as 1.
I don't seem to have any errors in that column. I can't figure out what is wrong with the count. Any other suggestions?
-
Try this one then, I was also able to replicate it when there was a number value in the range. Column3 shows the formulas that I have calculating in Column4. So maybe you have a number in your range of text fields. So the solution would be to find the distinct numbers and add them to the distinct texts:
=COUNT(DISTINCT(COLLECT(ID:ID, ID:ID, ISTEXT(@cell)))) + COUNT(DISTINCT(COLLECT(ID:ID, ID:ID, ISNUMBER(@cell))))
Jason Tarpinian - Sevan Technology
Smartsheet Aligned Partner
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.5K Get Help
- 448 Global Discussions
- 145 Industry Talk
- 481 Announcements
- 5.1K Ideas & Feature Requests
- 85 Brandfolder
- 152 Just for fun
- 73 Community Job Board
- 492 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 304 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!