COUNTIF Function Within Date Range
Hello,
I am trying to write a COUNTIFS formula that would pull within a certain date range. Right now, the criteria would be to pull from a specific Project Reach and then an expiration between 1/1/2021 and 1/31/2021. The formula I have right now is not producing a count, so I'm doing something wrong:
=COUNTIFS({S2G Master ROE Data Range 1}, "=PORT ARTHUR", {S2G Master ROE Data Range 7}, ">=01/01/2021", {S2G Master ROE Data Range 7}, "<=01/31/2021")
Any suggestions for how to fix this? I'd like to replicate it for each month so we can forecast upcoming expirations.
Thank you!
Best Answer
-
Try this...
=COUNTIFS({S2G Master ROE Data Range 1}, "PORT ARTHUR", {S2G Master ROE Data Range 7}, >= DATE(2021, 01, 01), {S2G Master ROE Data Range 7}, <= DATE(2021, 12, 31))
Another option would be to just search on the year...
=COUNTIFS({S2G Master ROE Data Range 1}, "PORT ARTHUR", {S2G Master ROE Data Range 7}, IFERROR(YEAR(@cell), 0) = 2021)
Answers
-
Try this...
=COUNTIFS({S2G Master ROE Data Range 1}, "PORT ARTHUR", {S2G Master ROE Data Range 7}, >= DATE(2021, 01, 01), {S2G Master ROE Data Range 7}, <= DATE(2021, 12, 31))
Another option would be to just search on the year...
=COUNTIFS({S2G Master ROE Data Range 1}, "PORT ARTHUR", {S2G Master ROE Data Range 7}, IFERROR(YEAR(@cell), 0) = 2021)
-
That WORKED! THANK YOU SO MUCH!
-
Happy to 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!