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
- Smartsheet Customer Resources
- 63.9K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 457 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!