How do I subtract a date from a date for a sum of total years?

P

Paige

I am trying to calculate how many years an employee has worked. I have start
date and current date. What is the formula to return years worked?
 
G

Gary''s Student

If the current date is in A1 and the start date is in B1, then

=year(A1)-year(B1) formatted as general will return the number of years
worked.
 
R

Roger Govier

Hi Paige

One way
=DATEDIF(Startdate,currentdate,"y") for years only
=DATEDIF(Startdate,currentdate,"m") for months only
=DATEDIF(Startdate,currentdate,"ym") for remaining months excluding whole years.

Assuming start date in A1, Current date in B1
=DATEDIF(A1,B1,"y")&" years "&DATEDIF(A1,B1,"ym")&" months"

You could make B1=TODAY() to always give the latest date if required.

Regards

Roger Govier
 
Top