Choose Older Date between 2 dates and then calculate # of Years

Hi everyone! I have a list that shows hire date and in some instances a rehire date. I want to be able to calculate the years of service based on which ever date is the newest. See snip.

This is the formula and it calcs correctly on the hire date, but returns blank if there is a rehire date. What am I missing??

=IF([Hire Date]@row >= [Rehire Date]@row, (YEAR(TODAY()) - YEAR([Hire Date]@row, OR([Rehire Date]@row >= [Hire Date]@row, (YEAR(TODAY()) - YEAR([Rehire Date]@row))))))

Thanks in advance!!

Tags:

Best Answer

  • Emily Zeiger
    Emily Zeiger ✭✭✭✭
    Answer ✓

    Depending on preference, one of these might work:


    =IF([Hire Date]@row >= [Rehire Date]@row, YEAR(TODAY()) - YEAR([Hire Date]@row), YEAR(TODAY()) - YEAR([Rehire Date]@row))

    or

    =IF([Hire Date]@row >= [Rehire Date]@row, YEAR(TODAY()) - YEAR([Hire Date]@row), IF([Rehire Date]@row >= [Hire Date]@row, YEAR(TODAY()) - YEAR([Rehire Date]@row)))

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!