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
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!