DATEDIF
Calculates the number of days, months, or years between two dates
Syntax
DATEDIF(start_date, end_date, unit)
Parameters
- start_date: Required. A date that represents the first, or starting, date of a given period
- end_date: Required. A date that represents the last, or ending, date of the period
- unit: Required. The type of information to return: "Y" (years), "M" (months), "D" (days), "MD" (days ignoring months/years), "YM" (months ignoring years), "YD" (days ignoring years)
Example
=DATEDIF("1/1/2020", "1/1/2024", "Y")