The DATEDIF function is useful for finding the difference between two date values in years, months or days.
Syntax:
=DATEDIF (start date,end date,unit)
Arguments-
- Start date – The date from which you want to find the difference.
- End date – The date until which you want to find the difference.
- Unit – The time unit to use (years, months, or days).
Unit | Result |
“y” | Difference in complete years |
“m” | Difference in complete months |
“d” | Difference in days |
“md” | Difference in days, ignoring months and years |
“ym” | Difference in months, ignoring years |
“yd” | Difference in days, ignoring years |
Examples: