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.
-
What am I doing wrong with this version?
=COUNTIF({Returns - Created}, (IFERROR(MONTH(@cell), 0) = 1), IFERROR(year(@Cell),0)=2025))I've also tried
=COUNTIF({Returns - Created}, AND(IFERROR(MONTH(@cell), 0) = 1), IFERROR(year(@Cell),0)=2025))
It keeps returning #UNPARSEABLE
Thank you
-
@AtomicDancer Your second one is closest. "@cell" is case sensitive and should be all lowercase.
-
Thank you for the tip about @cell being case-sensitive.
Even with changing that, I am still getting #UNPARSEABLE
=COUNTIF({Returns - Created}, AND(IFERROR(MONTH(@cell), 0) = 1), IFERROR(year(@cell),0)=2025))
Both halves work individually, but not when combined.
=COUNTIF({Returns - Created}, IFERROR(MONTH(@cell), 0) = 1)
=COUNTIF({Returns - Created}, IFERROR(year(@cell),0)=2025)
-
Ah. Sorry for missing it on the first comment. The closing parenthesis after the 1 also needs to be removed.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.6K Get Help
- 435 Global Discussions
- 152 Industry Talk
- 495 Announcements
- 5.3K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 77 Community Job Board
- 508 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!