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

ArgumentRequiredWhat it means
start_dateYesThe beginning date of the interval.
end_dateYesThe ending date of the interval.
unitYesA text code that selects days, months, years, or a remaining component.

Examples

Count complete months

ABC
1MemberStartReview
2Ava1/15/20244/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.