Count Distinct Values that only appear multiple times
I have a formula that follows this structure
=count(distinct(collect(range, crit_range1, crit1, etc)))
that allows me to count the number of unique entries that meet a set of criteria. Now I'm trying to modify that formula that allows me to count the number of repeat entries that meet a set of criteria.
In the original formula, I'd get a result of 4 (assuming this list met all the criteria). With the new formula that I'm asking for help with, I'd get a result of 2 (John and James show up multiple times on the list).
Best Answer
-
Hello @Jeremy Center
In my approach, I needed a helper column (checkbox) to accomplish this. You can slide the checkbox column to the far right and hide it. I would make this a column formula
In the helper column
=IF(COUNTIFS([your john doe column]:[your john doe column], [your john doe column]@row) > 1, 1)
The above is finding any entry that occurs in your name column more than once.
Then bring this helper column into your Count/Distinct/Collect where that helper column has a 1
=COUNT(DISTINCT(COLLECT([your john doe column]:[your john doe column], [your john doe column]:[your john doe column], <>"", [helper checkbox]:[helper checkbox],1)))
The DISTINCT will only count the checkbox columns once.
does this work for you?
Kelly
Answers
-
Hello @Jeremy Center
In my approach, I needed a helper column (checkbox) to accomplish this. You can slide the checkbox column to the far right and hide it. I would make this a column formula
In the helper column
=IF(COUNTIFS([your john doe column]:[your john doe column], [your john doe column]@row) > 1, 1)
The above is finding any entry that occurs in your name column more than once.
Then bring this helper column into your Count/Distinct/Collect where that helper column has a 1
=COUNT(DISTINCT(COLLECT([your john doe column]:[your john doe column], [your john doe column]:[your john doe column], <>"", [helper checkbox]:[helper checkbox],1)))
The DISTINCT will only count the checkbox columns once.
does this work for you?
Kelly
-
I love clever solutions! Thank you for your help.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!