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

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    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, IT Business Analyst & Project Coordinator, Mitsubishi Electric Trane US

    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

  • Hollie Green
    Hollie Green ✭✭✭✭✭

    =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.

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    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, IT Business Analyst & Project Coordinator, Mitsubishi Electric Trane US

    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

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!