Countifs Question
I have a sheet that has 2 date columns, 1 is the date we scheduled an activity, the 2nd column is the date that it was actually completed. I need to count the number of times these dates are the same broken out by month.
COUNTIFS([Date1]:[Date1], [Date2]:[Date2], [Date1]:[Date1], >=DATE(2023, 1, 1), [Date1]:[Date1], <=DATE(2023, 1, 31))
I need to write a report that shows every month with this number:
Month comp. on original date comp. on different date
Jan 100 0
Feb 50 23
Mar
Apr
etc.
I'm using that formula above, but it's not working
Best Answer
-
You'll need a helper column on the source sheet to indicate whether the two dates are the same or not on each row.
=IF([Date1]@row = [Date2]@row, "Yes", "No")
Then you would count from one of the date columns and this yes/no column.
=COUNTIFS({Date 1}, AND(IFERROR(MONTH(@cell), 0) = 1, IFERROR(YEAR(@cell), 0) = 2024), {Helper Column}, @cell = "Yes")
Answers
-
You'll need a helper column on the source sheet to indicate whether the two dates are the same or not on each row.
=IF([Date1]@row = [Date2]@row, "Yes", "No")
Then you would count from one of the date columns and this yes/no column.
=COUNTIFS({Date 1}, AND(IFERROR(MONTH(@cell), 0) = 1, IFERROR(YEAR(@cell), 0) = 2024), {Helper Column}, @cell = "Yes")
-
Thank you Paul! It works beautifully. I also had to explicitly say which was were completed on a different date, so I just changed the "Yes" to a "No" a voila….
However, now I am being asked to mark the ones that were completed on a different month, so the month of the original date is March, but it was completed not only on a different date, but a different month, say July. I need to know that
-
Take that same IF and wrap each date reference in a MONTH function
=IF(MONTH[Date1]@row) = MONTH([Date2]@row), "No", "Yes")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!