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))
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
-
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)
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
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))
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
-
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)
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
-
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.
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.8K Get Help
- 376 Global Discussions
- 207 Industry Talk
- 440 Announcements
- 4.5K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 284 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!