Return 0 instead of negative number

Options
LeAndre P
LeAndre P ✭✭
edited 08/30/21 in Formulas and Functions

Hello,

I have a formula that calculates the number of years between contract dates and a second formula to calculate time remaining. The time remaining formula works as expected before reaching and passing the date of expiration within the formula. Currently, when the date of expiration is either met or have past, the formula returns the number of days after the date of expiration as a -negative number. When this happens I would like to have a 0 return instead of a negative number.

This is the formation I am currently using:

=(ABS(TODAY() - [Warranty Expiration Date]@row) / 365.25)

 

Thanks in advance,

Best Answer

  • LeAndre P
    LeAndre P ✭✭
    Answer ✓
    Options

    Thanks Paul

    the following formula seems to work as expected..

    =IF([Warranty Expiration Date]@row > TODAY(), NETDAYS(TODAY(), [Warranty Expiration Date]@row) / 365, IF([Warranty Expiration Date]@row < TODAY(), 0))

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!