CountIfs with Multiple Criteria including Dates
I am trying to count a monthly total of submissions in a given category, in this case "survey". There are three subcategories (below) and they live in the Request Type reference range. What am I missing? I keep getting a zero when I should be getting 11.
The below Countifs fx works without the "({Request Type}, "Surveys - Custom Cut", {Request Type}, ="Surveys - Analysis/Investigation", {Request Type}, ="Surveys - New Custom Survey" part of the syntax but I only want the count of these specific subcategories
=COUNTIFS({Request Type}, "Surveys - Custom Cut", {Request Type}, "Surveys - Analysis/Investigation", {Request Type}, "Surveys - New Custom Survey", {Requested On}, >=DATE(2022, 8, 31), {Requested On}, <=DATE(2022, 10, 1))
Best Answers
-
When you follow the standard syntax of a COUNTIFS, each range/criteria group has an implied "AND" in between. So basically your formula is looking for a cell that equals exactly "Surveys - Custom Cut" and exactly "Surveys - Analysis/Investigation" and exactly "Surveys - New Custom Survey" all at the same time which just isn't possible.
You will need to work in an OR statement like so:
=COUNTIFS({Request Type}, OR(@cell = "Surveys - Custom Cut", @cell = "Surveys - Analysis/Investigation", @cell = "Surveys - New Custom Survey"), {Requested On}, >=DATE(2022, 8, 31), {Requested On}, <=DATE(2022, 10, 1))
-
Thanks Paul! I had found this solution and had tried it...makes complete sense....was getting an #UNPARSEABLE, but my () were in the wrong spots. You rock per usual! :)
Answers
-
When you follow the standard syntax of a COUNTIFS, each range/criteria group has an implied "AND" in between. So basically your formula is looking for a cell that equals exactly "Surveys - Custom Cut" and exactly "Surveys - Analysis/Investigation" and exactly "Surveys - New Custom Survey" all at the same time which just isn't possible.
You will need to work in an OR statement like so:
=COUNTIFS({Request Type}, OR(@cell = "Surveys - Custom Cut", @cell = "Surveys - Analysis/Investigation", @cell = "Surveys - New Custom Survey"), {Requested On}, >=DATE(2022, 8, 31), {Requested On}, <=DATE(2022, 10, 1))
-
Thanks Paul! I had found this solution and had tried it...makes complete sense....was getting an #UNPARSEABLE, but my () were in the wrong spots. You rock per usual! :)
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.1K Get Help
- 444 Global Discussions
- 142 Industry Talk
- 472 Announcements
- 5K Ideas & Feature Requests
- 83 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 489 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!