Nested IF with COUNTIF
I need to use a nested IF with COUNTIF. Is that possible? The scenario is that I need to count the number of “Red,” “Yellow,” and “Green” balls that are in a particular row in another sheet. Then,
- If count of “Red”>=1, return “Red”
- If count of “Yellow”=1, return “Yellow”
- If count of “Green”=8 (or all), return “Green”
…in that hierarchy.
I have the individual COUNTIF statements as follows:
=IF(COUNTIF({Copy of Compliance & Integration Detail Da Range 1}, "Red") >= 1, "Red")
=IF(COUNTIF({Copy of Compliance & Integration Detail Da Range 1}, "Yellow") = 1, "Yellow")
=IF(COUNTIF({Copy of Compliance & Integration Detail Da Range 1}, "Green") = 8, "Green")
Can't seem to figure out how to nest them into one IF statement with the embedded COUNTIF statements.
Comments
-
=IF(COUNTIF({Copy of Compliance & Integration Detail Da Range 1}, "Red") >= 1, "Red", IF(COUNTIF({Copy of Compliance & Integration Detail Da Range 1}, "Yellow") = 1, "Yellow", IF(COUNTIF({Copy of Compliance & Integration Detail Da Range 1}, "Green") = 8, "Green")))
Give this a go...
-
Thanks. I'll give that a try.
-
Paul,
Thanks for the assist. That syntax worked to a certain point. I had to tweak it, and it works perfectly now.
=IF(COUNTIF({Compliance & Integration Detail Dashboard Range 1}, "Red") >= 1, "Red", IF(COUNTIF({Compliance & Integration Detail Dashboard Range 1}, "Yellow") >= 1, "Yellow", IF(COUNTIF({Compliance & Integration Detail Dashboard Range 1}, "Green") >= 8, "Green")))
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
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!