Help with formula in calculating time of service
I am working on a column formula (Years of Service) to calculate the years, months and days as of TODAY from the employees’ benefits service date see formula below I am using.
=YEAR(TODAY()) - YEAR([Benefits Svc Date]@row) - IF(DATE(YEAR([Benefits Svc Date]@row), MONTH(TODAY()), DAY(TODAY())) < [Benefits Svc Date]@row, 1, 0) + " years " + IF(MONTH(TODAY()) - MONTH([Benefits Svc Date]@row) < 0, 12 + MONTH(TODAY()) - MONTH([Benefits Svc Date]@row), MONTH(TODAY()) - (MONTH([Benefits Svc Date]@row)) - 1) + " months " + IF(DAY(TODAY()) - DAY([Benefits Svc Date]@row) < 0, 30 + DAY(TODAY()) - DAY([Benefits Svc Date]@row), DAY(TODAY()) - DAY([Benefits Svc Date]@row)) + " days"
However, I am not sure I’ve got it correct. For example the two highlighted below, the one with a benefits date of 8/14/2023 is calculating 0 years -1 months 24 days, should it not be calculating 0 years 11 months 24 days? Am I missing something? Any guidance would help thank you!
Answers
-
There was a post last year about this same question. I don't know if it has the answer you are looking for; hope it helps:
Calculating Exact Days, Months & Years between 2 dates — Smartsheet Community
-
@Jeff Reisman Hello Jeff, tagging you as Pauline shared a helpful response you had on a previous similar post wondering if you had any insight?
Thanks!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 422 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!