Google Sheets function
DATEDIF function in Google Sheets
DATEDIF in Google Sheets calculates the number of complete days, months, or years between two dates, with additional units for remaining month or day components. Use it to measure elapsed age, tenure, or reporting intervals when complete calendar units matter.
Source: Google Docs Editors HelpLast verified Nov 5, 2026
Syntax
=DATEDIF(start_date, end_date, unit)Arguments
| Argument | Required | What it means |
|---|---|---|
start_date | Yes | The beginning date of the interval. |
end_date | Yes | The ending date of the interval. |
unit | Yes | A text code that selects days, months, years, or a remaining component. |
Examples
Count complete months
| A | B | C | |
|---|---|---|---|
| 1 | Member | Start | Review |
| 2 | Ava | 1/15/2024 | 4/15/2024 |
=DATEDIF(B2,C2,"M")Result: 3
Exactly three complete months pass between January 15 and April 15.
Common mistakes
Putting the later date before the earlier date.
Use the earlier date as start_date and the later date as end_date.
Writing the unit without quotation marks.
Pass the unit as text, such as "M" for complete months.