DATEDIF
Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.
Date & TimeDates & Time Calculations
What it does
Calculates the difference between two dates in specified units (Y, M, D, YM, MD, YD).
Syntax
DATEDIF(start_date, end_date, unit)
Arguments
start_date(date) β Start date.end_date(date) β End date.unit(text) β "Y", "M", "D", "MD", "YM", "YD".
Examples
Calculate Age
Years between birth and today.
FORMULA
=DATEDIF(A2, TODAY(), "Y")
RESULT
30
SAMPLE DATA
| A | |
|---|---|
| 1 | Birthdate |
| 2 | 1994-01-01 |