0

I have a sheet to calculate employees length of service.

enter image description here

Now with my current formula

=DATEDIF(D2,E2,"y") & " years, " & DATEDIF(D2,E2,"ym") & " months, " & DATEDIF(D2,E2,"md") & " days"

I am getting 11 years, 7 months, 9 days

But I need this "12 years" instead of "11 years, 7 months, 9 days". Also if it is less than 6 month[example: 11 years, 5 months, 9 days] in result should come previews year[11 years].

1 Answer 1

0

I don't have Excel on this machine, but something like this should work:

=ROUND(DATEDIF(D2,E2,"d")/365.25, 0)
2
  • Thanks for your answer but it's returned to "You've entered too few arguments for this function" Jun 19, 2014 at 11:00
  • Try adding ,0 before the final parenthesis. As I said, I don't have Excel on this machine; I expected that you could do the fine-tuning on your own.
    – Tom Zych
    Jun 19, 2014 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.