What does it do?

Calculates the number of Days, Months, or Years between two dates

Formula breakdown:

=DATEDIF(Start Date,End Date,Interval)

What it means:

=DATEDIF(starting date, ending date, the unit of measurement)

Where INTERVAL is:

m” Months , “ym” Months Excluding Years
d” Days , “yd” Days Excluding Years
y” Years , “md” Days Excluding Years And Months

The DATEDIF function is a mystery function within Excel.  When you write it out in a workbook it doesn’t give you any hints like other functions would and if you look it up in the function list you would not find it! Creepy…

The DATEDIF function stands for “date difference” and it calculates the number of Days, Months, or Years between two dates.

So if you want to find out how many days, years or months have passed since you were born, well this is the formula for you!   Well you can also extend this to project start and end dates, but you get my point.


STEP 1: Enter the Start Date

Datedif Formula


STEP 2: Enter the End Date

Datedif Formula


STEP 3: To get the number of months as a difference, type in the following formula

=DATEDIF(B12, B15, “m”)

The DATEDIF arguments:

B12 is the startdate
B15 is the enddate
m tells it to count in total months

Datedif Formula


STEP 4: To get the number of days on this year from your birthday, type in the following formula

=DATEDIF(B12, B15, “yd”)

The DATEDIF arguments:

B12 is the startdate
B15 is the enddate
yd tells it to count in days but excluding the year portion

Datedif Formula


And you have your calculated differences!

Datedif Formula


How to Use the DateDif Formula in Excel



How to Combine VLOOKUP and IFERROR to Replace the #N/A Error in Excel


If you like this Excel tip, please share itEmail this to someone


Pin on Pinterest


Share on Facebook


Tweet about this on Twitter


Share on LinkedIn


Share on Google+


Related Posts

GETPIVOTDATA Function What does it do? A formula that extracts data stored in a Pivot Table Formula breakdown: =GETPIVOTDATA(data_field, pivot_table, , ,...) What it means: =GETPIVOTDATA(return me this value from the Values Area, any cell within the Pivot Table, ,...)   T...
Total Bonus Due With An Array Lookup Formula The LOOKUP function has three arguments, it is a like a simplified VLOOKUP function: What does it do? It looks up a value (lookup_value) in one range (lookup_vector) and returns a value from the same position in a second range (result_vector) Formula breakdown: =LOOKU...
INDIRECT Function for Dependent Dropdown Lists in ... The INDIRECT function is really cool as it opens up a lot of interesting combinations in Excel. We will use the power of the INDIRECT function right now on creating Dependent Dropdown Lists. DOWNLOAD EXCEL WORKBOOK Let us go through the steps in detail:   STEP...
In-Cell Bar Charts with the REPT Function When you are creating an Excel Dashboard and are limited by space and do not want to insert a chart, you can easily create an in-cell bar chart using the RPT (repeat) function. The RPT function uses the vertical bar character | as the first argument: text and references the va...