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
- 65.2K Get Help
- 445 Global Discussions
- 143 Industry Talk
- 476 Announcements
- 5K Ideas & Feature Requests
- 84 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!