# Can you generate a date with limits?

✭✭✭

I am working within a tracker, and I have the date autogenerating.

Currently the date will generate once the first update will occur, and I just did =[Review Date]@row + 60 so that it adds 60 days from the review date. However, the program ends 12/31 so I want to add a limit so that if 60 days from the review date is after 12/31, the date maxes out at 12/31. Is there a way I can do this?

Thank you!!

Tags:

• ✭✭✭✭✭
edited 02/14/23

What do you want your result to be? You can incorporate an IF statement for that. You would just need to put in the right parameters you want to see when the review date is after 12/31.

You can put this in a date column:

=IF([Review Date]@row + 60 > DATE(2023, 12, 31), "Exceeds 12/31 end", [Review Date]@row + 60)

You can replace the "Exceeds 12/31 end" with whatever you want to see when the Review Date + 60 exceeds the date you specify.

Breakdown:

=IF([Review Date]@row + 60 - if your review date in the row + 60 days

> DATE(2023, 12, 31) - is greater than this date

, "Exceeds 12/31 end" - then show this in this cell

, [Review Date]@row + 60) - otherwise show this in this cell

• ✭✭✭✭✭✭

=IF([Review Date]@row + 60 > DATE(2023, 12, 31), DATE(2023, 12, 31), [Review Date]@row + 60)

This formula will return the Review Date + 60 days unless the returned date is greater than Dec 31st 2023. If it is greater than Dec 31st 2023 then it will just return Dec 31st 2023.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!