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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!