Home › Functions › Date & Time › DATEDIF
fx
DATEDIF
Date & Time  ·  Since: Excel 2003  ·  9 languages

Calculates the number of days, months, or years between two dates.

🌐 Translations

English DATEDIF
Deutsch DATEDIF
Français DATEDIF
Español SIFECHA
Italiano DATA.DIFF
Português DATADIF
Nederlands DATUMVERSCHIL
Polski DATA.RÓŻNICA
Русский РАЗНДАТ

📦 Availability

Excel versionAvailable
Excel 2007 ✓
Excel 2013 ✓
Excel 2019 ✓
Excel 2021 ✓
Microsoft 365 ✓
Translate a formula with this function
fx EN
fx DE

⌨ Syntax

DATEDIF(start_date,end_date,unit)

Arguments

start_date (required) — A date that represents the first, or starting date of a given period. Dates may be entered as text strings within quotation marks (for example, "2001/1/30"), as serial numbers (for example, 36921, which represents January 30, 2001, if you're using the 1900 date system), or as the results of other formulas or functions (for example, DATEVALUE("2001/1/30")).
end_date (required) — A date that represents the last, or ending, date of the period.
unit (required) — The type of information that you want returned, where: Unit****Returns " Y "The number of complete years in the period." M "The number of complete months in the period." D "The number of days in the period." MD "The difference between the days in start_date and end_date. The months and years of the dates are ignored. Important: We don't recommend using the "MD" argument, as there are known limitations with it. See the known issues section below." YM "The difference between the months in start_date and end_date. The days and years of the dates are ignored" YD "The difference between the days of start_date and end_date. The years of the dates are ignored.

▶ Examples

=DATEDIF(Start_date,End_date,"Y")
=DATEDIF(Start_date,End_date,"D")
=DATEDIF(Start_date,End_date,"YD")

Related functions

Copied to clipboard