Calculate time between dates with DateDif()

Posted on

Jun,17

 at

4:34 pm

by

jimazing

Use the DATEDIF when you want to caclulate the time between two dates. The time could be how many days, months or years.

The syntax for DATEDIF is

=DATEDIF(Date1, Date2, Interval)

Where:
Date1 is the earlier date,
Date2 is the later date,
Interval is the interval type to return (see table below)

Interval

Meaning

Description

m

Months

Complete calendar months between the dates.

d

Days

Number of days between the dates.

y

Years

Complete calendar years between the dates.

ym

Months Excluding Years

Complete calendar months between the dates as if they were of the same year.

yd

Days Excluding Years

Complete calendar days between the dates as if they were of the same year.

md

Days Excluding Years And Months

Complete calendar days between the dates as if they were of the same month and same year.

http://www.cpearson.com/excel/datedif.aspx

Leave a Reply