Full width home advertisement

Post Page Advertisement [Top]

Excel Formula

How To Calculate Years Of Service In Excel

 DATEDIF(hire_date, end_date, "d")/365



The formula "=DATEDIF(hire_date, end_date, "d")/365 " calculates the number of years between two dates (the hire date and the end date) by first calculating the difference in days using the DATEDIF function with the "d" argument, and then dividing the result by 365.

Here's a breakdown of the formula:

  1. "DATEDIF(hire_date, end_date, "d")" calculates the difference between the hire date and the end date in days. The "d" argument specifies that the result should be in days.
  2. The result of the DATEDIF function is then divided by 365 to convert the number of days to years. This assumes that each year has 365 days.
  3. The result is the number of years between the hire date and the end date, rounded down to the nearest whole number.
  4. For example, if the hire date is January 1, 2020, and the end date is June 30, 2021, the formula would calculate the difference between these two dates in days (546 days), and then divide this result by 365 to get the number of years of service (1.49589 years).

Note that this formula only gives an approximation of the number of years of service, as it assumes that each year has 365 days, which is not always the case due to leap years. To account for leap years, you can divide the result by 365.25 instead.

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib
Youtube Channel Image
ExcelVba DIY SUBSCRIBE for Excel Tutorials
Subscribe