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
- 63.6K Get Help
- 403 Global Discussions
- 215 Industry Talk
- 454 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 136 Just for fun
- 56 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!