#UNPARSEABLE using COUNTIF for text objects
I have a Form which allows the recipient to answer a question via a drop down list:
Example: Where would you like to go for vacation?
List includes: U.S., Europe, Asia, Australia
It's a pick many list so users can select any number of answers. The resulting cell then may contain something like: U.S. Europe Asia
I would like to create a COUNTIF for each of the possible contents so the end result looks like:
[RESULTS] [COUNT]
U.S. 7
Europe 16
Asia 24
Australia 8
My formula looks like this:
=COUNTIF([Destination], CONTAINS(U.S.)
What am I missing here?
Best Answer
-
Try:
=COUNTIF([Destination]:[destination], HAS(@cell, "U.S."))
HAS looks for an exact match in multiselect cells.
https://help.smartsheet.com/function/has
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
Answers
-
Try:
=COUNTIF([Destination]:[destination], CONTAINS("U.S.",@cell))
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
That did solve the problem but now I have another issue: The list is a little longer than what I used for the example and now I'm having data quality issues. For example, with "U.S." and "U.S. Virgin Islands" in the pick list, the provided formula is counting both options seemingly because they both contain "U.S.". Do you know how I can make it count only exactly what's in the quotes?
-
Try:
=COUNTIF([Destination]:[destination], HAS(@cell, "U.S."))
HAS looks for an exact match in multiselect cells.
https://help.smartsheet.com/function/has
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
Well done, @Mark Cronk! You are a SmartSheet wizard
-
Glad you found a solution. Thank you for contributing to the Community.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 58 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!