ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I subtract a date from a date for a sum of total years? (https://www.excelbanter.com/excel-discussion-misc-queries/52505-how-do-i-subtract-date-date-sum-total-years.html)

Paige

How do I subtract a date from a date for a sum of total years?
 
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?

Gary''s Student

How do I subtract a date from a date for a sum of total years?
 
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.
--
Gary''s Student


"Paige" wrote:

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?


Roger Govier

How do I subtract a date from a date for a sum of total years?
 
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


Paige wrote:
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?


hideki

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

You can use DATEDIF function

eg: DATEDIF(startDate, currentDate,"Y")


--
hideki
------------------------------------------------------------------------
hideki's Profile: http://www.excelforum.com/member.php...o&userid=18903
View this thread: http://www.excelforum.com/showthread...hreadid=479748


Dave Peterson

How do I subtract a date from a date for a sum of total years?
 
You can find lots of info at Chip Pearson's site:
http://www.cpearson.com/excel/datedif.htm

(=datedif() was only documented in xl2k's help.)



Paige wrote:

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?


--

Dave Peterson


All times are GMT +1. The time now is 10:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com