DATEDIF
Syntax:
DATEDIF ( start-date , end-date , unit )
Description: Calculates the number of days, months, or years between two dates.
Arguments:
Name |
Type |
Description |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
start-date |
number |
The first date in the period, truncated to integer. |
||||||||||||||
end-date |
number |
The last date in the period, truncated to integer. |
||||||||||||||
unit |
text |
The count to be returned, as follows:
|
Return Type and Value: number – The number of days, months, or years between two dates, depending on the value of unit.
However, if
start-date or end-date is out of range for the current date base value,
#NUM!
is returned.start-date ≥ end-date
#NUM!
is returned.unit is any value other than those shown in the table above,
#NUM!
is returned.