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
- Smartsheet Customer Resources
- 63K Get Help
- 380 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 305 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!