Share your computing skills tips and tricks with other members. Contribute and help others.





Google
 

Wednesday, March 2, 2011

Calculate number of years, months and days between 2 given dates

Calculate number of years, months and days between 2 given dates using Excel

In B1 Enter a date above: 01.01.1900
Enter any date in D1

Place the following formula in any cell and press enter.

=YEAR(DATE(YEAR(D1)-YEAR(B1),MONTH(D1)-MONTH(B1)+1,DAY(D1)-DAY(B1)+1))-1900&" Years "&IF(MONTH(DATE(YEAR(D1)-YEAR(B1),MONTH(D1)-MONTH(B1)+1,DAY(D1)-DAY(B1)+1))-1=0,"",MONTH(DATE(YEAR(D1)-YEAR(B1),MONTH(D1)-MONTH(B1)+1,DAY(D1)-DAY(B1)+1))-1&" Months ")&IF(DAY(DATE(YEAR(D1)-YEAR(B1),MONTH(D1)-MONTH(B1)+1,DAY(D1)-DAY(B1)+1))-1=0,"",DAY(DATE(YEAR(D1)-YEAR(B1),MONTH(D1)-MONTH(B1)+1,DAY(D1)-DAY(B1)+1))-1&" Days")

 

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home

 



Privacy Policy