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
- Smartsheet Customer Resources
- 62.5K Get Help
- 367 Global Discussions
- 202 Industry Talk
- 432 Announcements
- 4.4K Ideas & Feature Requests
- 137 Brandfolder
- 129 Just for fun
- 128 Community Job Board
- 446 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 286 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!