Count with criterion.criteria within multi-select cell
I have multi-select cells in a sheet. I can use countm to count all selected items in a specific cell. However I need to count specific selections based on criteria. For example: A dropdown contains:
L1-ABC, L1-LMN, L1-XYZ,L2-ABC,L2-LMN,L2-XYZ, L3-ABC,L3-LMN,L3-XYZ
One cell has: L1-ABC,L2-XYZ,L2-ABC,L3-XYZ
I want to search how many times a selection started with L2 was made? So the formula should return 2 for the above cell.
Best Answer
-
Hi Guys
I was excited to see that someone has put on a better example than me, as I love learning from other consultants too, however when I tested Nic's formula it didn't work properly for me.
So, I just want to clarify if the final formula works properly for you.
It appears in Nic one (please don't take this the wrong way!) that as soon as the Find command finds something that meets true within the multi select column, it stops looking for subsequent values. Hence it only finds 1 instance in each cell. But if you have more than 1 value in each cell that matches true, this formula will not be giving you a true count.
As you can see in this screen shot, the two formula's are asking the same thing, but one is returning 4 whereas the other is returning 7. Manually counting there are 7.
I really appreciate my version is not as succinct, and it will take longer to set up, but it is returning the true count!
This may not be an issue in your scenario, but please double check.
Kind regards
Debbie
Answers
-
I have a solution for you but it isn't terribly pretty... I can't find a way of nesting a LEFT type function inside a HAS function to only look at the first 2 letters of each code. I also can't find any wildcards that work with HAS. So I have achieved your requirement through a slightly long winded fashion, but it does work! :D
My Answer cell (returning 7) is looking at the column COUNT MULTI and returning all those that begin with L2.
My formula is:
=SUM(COUNTIF([COUNT MULTI]:[COUNT MULTI], HAS(@cell, "L2-ABC")), COUNTIF([COUNT MULTI]:[COUNT MULTI], HAS(@cell, "L2-LMN")), COUNTIF([COUNT MULTI]:[COUNT MULTI], HAS(@cell, "L2-XYZ")))
I understand that it is fine when there are only 3 or 4 values in the list that meet the condition you want, but as it is a multi-select I would imagine the list of entries is kept relatively small (?) so this would/could work for you?
I hope it gives you something to work on.
Kind regards
Debbie
-
This might also work:
=COUNTIFS(Count Multi]:[Count Multi], FIND("L2", @cell) > 0)
-
Hi Guys
I was excited to see that someone has put on a better example than me, as I love learning from other consultants too, however when I tested Nic's formula it didn't work properly for me.
So, I just want to clarify if the final formula works properly for you.
It appears in Nic one (please don't take this the wrong way!) that as soon as the Find command finds something that meets true within the multi select column, it stops looking for subsequent values. Hence it only finds 1 instance in each cell. But if you have more than 1 value in each cell that matches true, this formula will not be giving you a true count.
As you can see in this screen shot, the two formula's are asking the same thing, but one is returning 4 whereas the other is returning 7. Manually counting there are 7.
I really appreciate my version is not as succinct, and it will take longer to set up, but it is returning the true count!
This may not be an issue in your scenario, but please double check.
Kind regards
Debbie
-
Thanks Debbie. Your answer worked. Thank you. It works if the options to search from are limited. I hope later Smartsheet adds criteria to CountM function
-
Hi there. Glad to have found this thread and would love a little help tweaking for a specific need. I have columns where cells contain up to several responses (multi-select). I need a formula for my sheet summary to count responses. For example, how many times has someone selected Urban (whether by itself of with other value/s). My formula is only counting when Urban appears by itself.
Population Density (column title)
Values (multi-select): Urban, Rural, Suburban, Tribal, Other
Appreciate any help. Formulas aren't my forte (yet).
-
Hi @Amy Koné
To count within a Multi-Select column you'll want to use the HAS function (see here).
For example:
=COUNTIF([Population Density]:[Population Density], HAS(@cell, "Urban"))
This will check each cell (using @cell) in the previously stated range to see if it HAS that text, either on its own or with other values. Keep in mind that HAS is specific to exactly the text specified, so "Urban" will only count for "Urban" and it won't count "Suburban" even though the text is contained in that word.
Let me know if this works for you!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 422 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!