Excluding and Including data in a countifs formula
I need the total number of that meets the following criteria - Banner Name, Open, and not MA or NY. I am able to write the countifs to include the specific banner name and whether the status of that site is open, but I can't figure out how to exclude certain states or include certain states. This is what I tried below based off another community post, but it didn't work for me.
=COUNTIFS({ALL STORE Rollout Schedule-IT-1547-EG Range 1}, "Banner Name", {ALL STORE Rollout Schedule-IT-1547-EG Range 4}, "Open", NOT(OR({ALL STORE Rollout Schedule-IT-1547-EG Range 5} = "MA", {ALL STORE Rollout Schedule-IT-1547-EG Range 5} = "NY")))
Answers
-
Try this:
=COUNTIFS({ALL STORE Rollout Schedule-IT-1547-EG Range 1}, "Banner Name", {ALL STORE Rollout Schedule-IT-1547-EG Range 4}, "Open", AND({ALL STORE Rollout Schedule-IT-1547-EG Range 5} <> "MA", {ALL STORE Rollout Schedule-IT-1547-EG Range 5} <> "NY"))
<> means not equal to
-
@Mike TV I'm having trouble getting this to work. It's definitely on the right track of excluding those two states from the formula like I need, but when I apply it in my sheet it gives me an INVALID error. Any ideas?
-
@Mike TV I figured it out! There were two missing commas in the formula you gave me. Adding a comma before the <> worked perfectly.
-
@Andrée Starå Are you able to help me with something else in regards to this formula?
I first wanted to exclude NY and MA from the formula which I did and it works as expected returning the total results. Now I want to reference the same exact columns and ONLY include MA & NY. However, I use the COUNIFS formula below and it returns zero results which is in accurate. I can remove the reference to either MA or NY and it works, but not when I include both.
=COUNTIFS({ALL STORE Rollout Schedule-IT-1547-EG Range 1}, "Cumberland Farms", {ALL STORE Rollout Schedule-IT-1547-EG Range 4}, "Open", {ALL STORE Rollout Schedule-IT-1547-EG Range 5}, "MA", {ALL STORE Rollout Schedule-IT-1547-EG Range 5}, "NY")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 137 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!