CountIF Month AND Year
Trying to perform a CountIF AND function where a cell counts the reference cell containing a Specific Month and Specific Year. The following formula is returning unparsable error:
=COUNTIF({EHS Visit Tracker - DoV}, IFERROR(MONTH(@cell), 0) = 1), IFERROR(YEAR(@cell),0)=2020)
Can you help?
Best Answers
-
It is just a misplaced parenthesis. Try this one...
=COUNTIF({EHS Visit Tracker - DoV}, AND(IFERROR(MONTH(@cell), 0) = 1, IFERROR(YEAR(@cell),0)=2020))
-
You have a misplaced parenthesis, and the AND function is not needed in this case. Also, to include multiple ranges, you need to switch over to a COUNTIFS (with the "S" on the end) and use the following syntax...
=COUNTIFS(range_1, crieria_1, range_2, criteria_2, ....................................)
=COUNTIF({EHS Visit Tracker - Provider}, "AB", {EHS Visit Tracker - Date Range}, IFERROR(YEAR(@cell), 0) = 2020)
Answers
-
=COUNTIF({EHS Visit Tracker - DoV}, and(IFERROR(MONTH(@cell), 0) = 1), IFERROR(YEAR(@cell),0)=2020)
Use the AND function when you have multiple criteria
-
I tried that and I get an #Incorrect Argument Set error...
-
It is just a misplaced parenthesis. Try this one...
=COUNTIF({EHS Visit Tracker - DoV}, AND(IFERROR(MONTH(@cell), 0) = 1, IFERROR(YEAR(@cell),0)=2020))
-
Worked like a charm, thank you Paul!
-
What am I doing wrong with this version:
=COUNTIF({EHS Visit Tracker - Provider}, "AB"), AND(IFERROR(YEAR(@cell), 0) = 2020))
-
You have a misplaced parenthesis, and the AND function is not needed in this case. Also, to include multiple ranges, you need to switch over to a COUNTIFS (with the "S" on the end) and use the following syntax...
=COUNTIFS(range_1, crieria_1, range_2, criteria_2, ....................................)
=COUNTIF({EHS Visit Tracker - Provider}, "AB", {EHS Visit Tracker - Date Range}, IFERROR(YEAR(@cell), 0) = 2020)
-
Awesome, thank you again!
-
Happy to help! 👍️
Please don't forget to mark an answer as the "Accepted Answer". That way people looking for a similar solution or people looking for unanswered posts to help with know that there is a solution provided in the thread.
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!