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