• Welcome to Daffodil Computers Ltd..
 

News:

Daffodil Computers Limited is a leading It solution & education solution public company with a good relation to customers it has earned big respect from clients

Main Menu

Calculating Number of Days, Weeks, Months and Years between Dates

Started by bbasujon, August 15, 2012, 05:45:17 PM

Previous topic - Next topic

bbasujon

Problem:

Calculating the difference between each pair of dates listed in columns
A & B.

Solution:

To calculate the difference in days, use the DATEDIF function as shown in the following formula:
=DATEDIF(A2,B2,"d")

To calculate the difference in weeks, use the INT function as shown in the following formula:
=INT((B2-A2)/7)

To calculate the difference in months, use the DATEDIF function as shown in the following formula:
=DATEDIF(A2,B2,"m")

To calculate the difference in years, use one of the following two solutions:
Use the DATEDIF function as shown in the following formula:
=DATEDIF(A2,B2,"y")

OR

Use the YEAR, MONTH, AND, and DAY functions as shown in the following formula:

=YEAR(B2)-YEAR(A2)-(MONTH(B2) To calculate the number of months over years, use the DATEDIF function as shown in the following formula:
=DATEDIF(A2,B2,"ym")

To calculate the number of days over years, use the DATEDIF function as shown in the following formula:
=DATEDIF(A2,B2,"yd")
Acquire the knowledge and share the knowledge so that knowing,learning then sharing - all are the collection