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!!
Best 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
-
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)))
-
THANK YOU SO MUCH! Perfection!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.2K Get Help
- 431 Global Discussions
- 152 Industry Talk
- 490 Announcements
- 5.2K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 74 Community Job Board
- 501 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 306 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!