COUNTIF formula help
I'm trying to create a formula that will count if a specific value is in a cell and the formula works as long as the cell only has 1 value in it. But I have some cells that contain more than 1 value, how do I get it to work for those cells?
Ex) There are 4 cells with the word Red. 3 cells with the word Blue and 3 cells with both Red and Blue - so the count for Red should be 7 and the count for Blue should be 6
=COUNTIF([Issues]:[Issues], "Red") - Returns a value of 4
=COUNTIF([Issues]:[Issues], (HAS([Issues]:[Issues], "Red"))) - Returns a value of 0
Best Answer
-
=COUNTIF([Issues]:[Issues], CONTAINS("Red", @cell))
Larry Cummings
https://primeconsulting.com/
Principal Consultant | Prime Consulting Group
Answers
-
=COUNTIF([Issues]:[Issues], CONTAINS("Red", @cell))
Larry Cummings
https://primeconsulting.com/
Principal Consultant | Prime Consulting Group -
Thank you so much!!!!!
-
Happy to help. The @cell functionality was new to me at first, but it is super helpful when you need to establish a range in an argument of the formula prior to establishing the logic argument.
In this scenario, I want to Count any field that CONTAINS "Red", & since I need to establish the "range" argument logic in the COUNTIF formula, when I am providing the "serach_within" logic in the subsequent CONTAINS formula, I simply use @cell.
Larry Cummings
https://primeconsulting.com/
Principal Consultant | Prime Consulting Group -
That makes so much sense, I really appreciate it
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
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives