Returns the difference in years, months, or days between the specified dates.
Syntax
![]() |
---|
DATEDIF( Date startDate, Date endDate, Text unit ) → Number |
The following table lists the possible values for the unit parameter:
Unit | Returns |
---|---|
"Y" | The number of complete calendar years in the period. |
"M" | The number of complete months in the period. |
"D" | The number of complete days in the period. |
"MD" | The number of days from startDate to endDate. The months and years of the dates are ignored. |
"YM" | The number of months from the month of startDate to the month of endDate. The days and years of the dates are ignored. |
"YD" | The number of days from startDate to endDate. The years of the dates are ignored. |
Formula
![]() |
---|
=DATEDIF(DATE(2000,1,1),TODAY(),"d") |
Function Reference
DAYS Function
DAYS360 Function