What it does
DATEDIF returns the difference between two dates in years, months or days.
Syntax or pattern
=DATEDIF(start_date, end_date, unit)5 practical examples
Calculate age in years
Return whole years between birth date and today.
=DATEDIF(A2,TODAY(),"Y")Common for age calculations.
Months between dates
Count complete months between two dates.
=DATEDIF(A2,B2,"M")Useful for tenure and durations.
Days between dates
Count complete days between two dates.
=DATEDIF(A2,B2,"D")Simple date difference.
Years and months label
Build a readable tenure label.
=DATEDIF(A2,TODAY(),"Y")&" years "&DATEDIF(A2,TODAY(),"YM")&" months"Combines two units.
Project duration
Measure project duration in months.
=DATEDIF(StartDate,EndDate,"M")Good for project summaries.
Common mistakes to avoid
- Check whether dates are real Excel dates, not text.
- Be careful with weekends, holidays and time portions.
- Explain whether a result counts calendar days or workdays.
Related Excel examples
FAQ
Why does the date formula return a number?
Excel stores dates as serial numbers. Format the cell as a date to display it correctly.