The DATEDIF function in Excel returns the difference between two date values in years, months, or days.
Syntax for DATEDIF Function in Excel
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:
When unit input is “d” Difference calculated will be in days
Result:
Difference between Dates in Months Using DATEDIF Function in excel
Formula:
When unit input is “m” Difference calculated will be in Months
Result:
Difference between Dates in Years Using DATEDIF Function in excel
Formula:
When unit input is “y” Difference calculated will be in Years
Result:
Difference in Days ignoring months and years
Formula:
When unit input is “md” Difference calculated will be in days by ignoring months and years
Result:
Difference in Months ignoring Days and years
Formula:
When unit input is “ym” Difference calculated will be in months by ignoring days and years
Result:
Difference in Days ignoring Years
Formula:
When unit input is “yd” Difference calculated will be in days by ignoring years and by taking days and months into account.
Result: