countif with date range
Hi all. I am trying to count the number of line items in March 2022. This is my equation.
=COUNTIF([Planned Pull Date]:[Planned Pull Date], >=DATE(2022, 3, 1), <=DATE(2022, 3, 31))
It comes up is incorrect argument set. What am I doing wrong?
Best Answers
-
You're close! You can use AND to consider two (or more) criteria for the same range.
=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(@cell >=DATE(2022, 3, 1), @cell <=DATE(2022, 3, 31)))
Alternatively, you can use YEAR and MONTH:
=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(YEAR(@cell) = 2022, MONTH(@cell) = 3))
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
You are a genius! Thank you so much @Jeff Reisman
Answers
-
You're close! You can use AND to consider two (or more) criteria for the same range.
=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(@cell >=DATE(2022, 3, 1), @cell <=DATE(2022, 3, 31)))
Alternatively, you can use YEAR and MONTH:
=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(YEAR(@cell) = 2022, MONTH(@cell) = 3))
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
You are a genius! Thank you so much @Jeff Reisman
-
If only my teenage kids recognized that, LOL.
Happy I could help!
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!