Check a Date Range
I need help with defining a formula to evaluate a date. I have a “Date” column which contains a mm/dd/yy date. I want to evaluate that column to return “Yes” if the date is within the current month and the next 60 days.
For example:
“Date” = 07/10/22
Today’s Date = 07/22/22
Is the “Date” within the range: 07/01/22 – 09/20/22*? In this example, it would be true and return “Yes”.
*09/20/22 derived from Today+60 days
What is the easiest way to do this? Asking before I end up in a formula quagmire.
Best Answer
-
Try this:
=IF(OR(MONTH(Date@row) = MONTH(TODAY()), AND(Date@row >= TODAY(), Date@row <= TODAY(60))), "Yes")
In English: If the Date on this row is in the current month, or if the Date on this row is greater than or equal to today AND less than or equal to the date 60 days from today, set this cell to "Yes".
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!
Answers
-
=IF([Date]@row >= DATE(2022, 7, 1), IF([Date]@row <= [Date]@row + 60, "yes", "no"))
For some reason, it doesn't return the no if it is false but the yes does return. Will need additional assistance if you need it to return a different value when false.
-
Try this:
=IF(OR(MONTH(Date@row) = MONTH(TODAY()), AND(Date@row >= TODAY(), Date@row <= TODAY(60))), "Yes")
In English: If the Date on this row is in the current month, or if the Date on this row is greater than or equal to today AND less than or equal to the date 60 days from today, set this cell to "Yes".
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!
-
Thank you @Jeff Reisman ! You save me what probably would have been an obscene amount of time. ;-) This worked perfect!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 494 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!