Simple COUNTIF with OR
Here is what I am trying to set up:
Count the no. of cells in Column A where condition X or condition Y is true. How do I write this in a formula?
Answers
-
More info is likely needed, but it would be something like this:
=COUNTIFS([Column A]:[Column A], OR(@cell = "Condition x", @cell = "Condition Y"))
-
What would @cell be?
If this is my data set, I want the "Apples" sheet summary field to count where "Apple" or "Apple, Orange" is true
Similarly, I want I want the "Orange" sheet summary field to count where "Orange " or "Apple, Orange" is true
-
@cell & @row are useful functions in Smartsheet to create more efficient formulas. More info here: Create efficient formulas with @cell and @row | Smartsheet Learning Center.
I would use a formula like this for the above scenario:
=COUNTIFS([Column A]:[Column A], OR(CONTAINS("Apple", @cell), CONTAINS("Orange", @cell)))
After I thought on it more, you probably need it like this:
Apples: =COUNTIFS([Column A]:[Column A], FIND("Apple", @cell) >= 1)
Oranges: =COUNTIFS([Column A]:[Column A], FIND("Orange", @cell) >= 1)
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!