countif by date references
I have a column of dates in one sheet called {Dates}
In a second sheet I want to analyze the dates based on if they fall into a specific calendar month
I have a column called Y (year) filled with data like 2020, and a column called M (month) filled with data like 1 (i.e. January) using the following formula:
=COUNTIFS({Dates}, MONTH(@cell) = M1, {Dates}, YEAR(@cell) = Y1)
I'm getting an invalid data type as a result.
I've also try comparing them to a column formated as a date called "target" as Month(@cell) =Month(target1) which also doesn't work.
Best Answer
-
Try something along the lines of
=COUNTIFS({Dates}, AND(IFERROR(MONTH(@cell), 0) = M@row, IFERROR(YEAR(@cell), 0) = Y@row))
Answers
-
Try something along the lines of
=COUNTIFS({Dates}, AND(IFERROR(MONTH(@cell), 0) = M@row, IFERROR(YEAR(@cell), 0) = Y@row))
-
thats a good one, Paul. Thanks.
-
Happy to help! 👍️
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!