Home › DATEDIF
Excel DATEDIF Function — Syntax, Example & Tips
Calculates the difference between two dates in days, months or years.
Syntax
=DATEDIF(start_date, end_date, unit)
Example
=DATEDIF(A2, B2, "m")
The number of months between two dates.
Tip
Units: d days, m months, y years. It does not show in autocomplete.
Want an expert to do it for you?
Gomaa Intelligence turns your data into clear reports and decisions. Tell us your problem and we will reply.
FAQ
What does DATEDIF do?
Calculates the difference between two dates in days, months or years.
How do I use DATEDIF?
=DATEDIF(A2, B2, "m") — The number of months between two dates.
Related functions
VLOOKUP · XLOOKUP · SUMIFS · COUNTIFS · IF · IFERROR · TEXTJOIN · TRIM · COUNTIF · SUMPRODUCT · UNIQUE · FILTER · TEXT