Datedif() Function

The Excel DATEDIF function returns the difference between two date values in years, months, or days. The DATEDIF (Date + Dif) function is a “compatibility” function that comes from Lotus 1-2-3.

Note: Excel won’t help you fill out the arguments for DATEDIF like other functions, but it will work when configured correctly. For reasons unknown, it is only documented in Excel 2000, but you can use it in your formulas in all Excel versions since that time.

Syntax:

=datedif(start_date,end_date,"unit")

start_date and end_date

The two dates to calculate the difference between.

Unit

The interval of time to use to calculate the difference between date1 and date2. Below is a list of valid interval values.

Remarks

  • Dates are stored as sequential serial numbers so they can be used in calculations. By default, December 31, 1899 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.
  • The DATEDIF function is useful in formulas where you need to calculate an age.