COUNTIF formula using a date column - Count number of dates in current month
Hi,
I am trying to write a formula that allows me to count the number of dates that have the current month. Have tried a few formulas and the only one I can get to work is the following however; I dont get the expected number which should be 4:
=COUNTIFS([Inactive Date]1:[Inactive Date]2232, ISDATE(@cell), [Inactive Date]1:[Inactive Date]2232, MONTH(@cell) = MONTH(TODAY()))
This returns a total of 83 instead of 4:
Note: I did ensure that my Inactive Date column is set to the Date type
Thanks in advance for your help :)
Nick Blocker - Analytics Adventurer
Best Answers
-
Your current formula will match any date with the current month, but it does not take into account the year. Try this instead:
=COUNTIFS([Inactive Date]1:[Inactive Date]2232, ISDATE(@cell), [Inactive Date]1:[Inactive Date]2232, MONTH(@cell) = MONTH(TODAY()), [Inactive Date]1:[Inactive Date]2232, YEAR(@cell) = YEAR(TODAY())
-
Awesome, I'm glad it worked for you!
Answers
-
Your current formula will match any date with the current month, but it does not take into account the year. Try this instead:
=COUNTIFS([Inactive Date]1:[Inactive Date]2232, ISDATE(@cell), [Inactive Date]1:[Inactive Date]2232, MONTH(@cell) = MONTH(TODAY()), [Inactive Date]1:[Inactive Date]2232, YEAR(@cell) = YEAR(TODAY())
-
That worked like a charm! Thank you for the quick reply and solution Carson!
Nick Blocker - Analytics Adventurer
-
Awesome, I'm glad it worked for you!
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!