0
0
Google Sheetsspreadsheet~5 mins

DATEDIF for differences in Google Sheets - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
DATEDIF helps you find the difference between two dates in days, months, or years. It is useful when you want to know how much time has passed between two events.
When you want to calculate a person's age from their birthdate.
When you need to find how many months have passed since a project started.
When you want to know the number of days between two appointments.
When you want to calculate the difference in years between two dates for a report.
When you want to track how long an employee has worked in months or years.
Steps
Step 1: Click
- the cell where you want the result
The cell is selected and ready for typing
Step 2: Type
- the formula bar
The formula is entered in the cell
💡 Start typing =DATEDIF(
Step 3: Enter
- the start date cell reference or date in quotes
The first date is added to the formula
Step 4: Type
- the formula bar after a comma
The formula waits for the next input
Step 5: Enter
- the end date cell reference or date in quotes
The second date is added to the formula
Step 6: Type
- the formula bar after a comma
The formula waits for the unit input
Step 7: Enter
- the unit in quotes: "Y" for years, "M" for months, or "D" for days
The formula is complete and ready to calculate
Step 8: Press
- Enter key
The cell shows the difference between the two dates in the chosen unit
Before vs After
Before
Cell A1 has 2020-01-01, Cell B1 has 2023-06-01, and Cell C1 is empty
After
Cell C1 shows 3 when formula =DATEDIF(A1, B1, "Y") is entered
Settings Reference
Start Date
📍 First argument in the DATEDIF formula
The earlier date to compare from
Default: No default, must be provided
End Date
📍 Second argument in the DATEDIF formula
The later date to compare to
Default: No default, must be provided
Unit
📍 Third argument in the DATEDIF formula
Defines the unit of difference to calculate
Default: No default, must be provided
Common Mistakes
Using the wrong unit code without quotes, like Y instead of "Y"
Google Sheets treats unquoted letters as cell references or errors
Always put the unit in double quotes, for example "Y"
Entering the end date before the start date
DATEDIF returns an error or unexpected result if the start date is after the end date
Make sure the start date is earlier than or equal to the end date
Using dates that are not recognized as dates by Google Sheets
The formula cannot calculate differences if dates are text or invalid
Ensure dates are valid date values or use DATE function to create dates
Summary
DATEDIF calculates the difference between two dates in years, months, or days.
You must provide start date, end date, and unit in quotes for the formula to work.
Make sure the start date is before the end date and the unit is typed correctly.