Count the dates in the current month
I have a list of dates in a column on a sheet. I am looking for a formula that would count only the dates in the current month and year, e.g., November for now and next month it should show the count for December 2022. It would be greatly appreciated if someone could help me out here.
Best Answer
-
Hey @Asha Krishnan
I will assume the formula is looking only at your current sheet and not bringing data in from a different sheet. The format of the formula changes slightly if using cross-sheet references.
=COUNTIFS([your date column]:[your date column],AND(ISDATE(@cell), YEAR(@cell)=YEAR(TODAY()), MONTH(@cell)=MONTH(TODAY()))
I added the ISDATE (which means only cells that have real dates in them will be evaluated) to help prevent any data errors. Be sure to change the [your date column] to match your actual column name
Will this work for you?
Kelly
Answers
-
Hey @Asha Krishnan
I will assume the formula is looking only at your current sheet and not bringing data in from a different sheet. The format of the formula changes slightly if using cross-sheet references.
=COUNTIFS([your date column]:[your date column],AND(ISDATE(@cell), YEAR(@cell)=YEAR(TODAY()), MONTH(@cell)=MONTH(TODAY()))
I added the ISDATE (which means only cells that have real dates in them will be evaluated) to help prevent any data errors. Be sure to change the [your date column] to match your actual column name
Will this work for you?
Kelly
-
@Kelly Moore Yes, your formula did the job. Thank you so much for your help!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.1K Get Help
- 444 Global Discussions
- 142 Industry Talk
- 472 Announcements
- 5K Ideas & Feature Requests
- 83 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 489 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!