DATEDIF Function in Excel – Difference between Dates in years, months or days

The DATEDIF function in Excel returns the difference between two date values in years, months, or days.

Syntax for DATEDIF Function in Excel

DATEDIF (start_date, end_date, unit)

Arguments

start_date Start Date
end_date End Date
unit Time units on which the output is required i.e. years, Months or days

 

Example of DATEDIF Function in Excel

Difference between Dates in Days Using Excel DATEDIF Function

Formula:

DATEDIF Function in Excel 1

When unit input is “d” Difference calculated will be in days

Result:

DATEDIF Function in Excel 1a

 

Difference between Dates in Months Using DATEDIF Function in excel

Formula:

DATEDIF Function in Excel 2

When unit input is “m” Difference calculated will be in Months

Result:

DATEDIF Function in Excel 2a

 

Difference between Dates in Years Using DATEDIF Function in excel

Formula:

DATEDIF Function in Excel 3

When unit input is “y” Difference calculated will be in Years

Result:

DATEDIF Function in Excel 3a

 

Difference in Days ignoring months and years

Formula:

DATEDIF Function in Excel 4

When unit input is “md” Difference calculated will be in days by ignoring months and years

Result:

DATEDIF Function in Excel 4a

 

Difference in Months ignoring Days and years

Formula:

DATEDIF Function in Excel 5

When unit input is “ym” Difference calculated will be in months by ignoring days and years

Result:

DATEDIF Function in Excel 5a

 

Difference in Days ignoring Years

Formula:

DATEDIF Function in Excel 6

When unit input is “yd” Difference calculated will be in days by ignoring years and by taking days and months into account.

Result:

DATEDIF Function in Excel 6a

previous DATEDIF Function in Excel                                                                                                 next DATEDIF Function in Excel