0
0
Google Sheetsspreadsheet~10 mins

DATEDIF for differences in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This data shows a start date in A2 and an end date in B2. We want to find the difference between these two dates in years, months, and days using the DATEDIF function.

CellValue
A1Start Date
B1End Date
C1Difference (Years)
D1Difference (Months)
E1Difference (Days)
A22020-01-15
B22023-06-10
Formula Trace
=DATEDIF(A2, B2, "Y")
Step 1: DATEDIF("2020-01-15", "2023-06-10", "Y")
Cell Reference Map
    A           B           C           D           E
1 |Start Date|End Date  |Diff (Yrs)|Diff (Mths)|Diff (Days)|
2 |2020-01-15|2023-06-10|    3     |           |           |
The formula references cells A2 (start date) and B2 (end date) to calculate the difference in years.
Result
    A           B           C           D           E
1 |Start Date|End Date  |Diff (Yrs)|Diff (Mths)|Diff (Days)|
2 |2020-01-15|2023-06-10|    3     |           |           |
The result of the formula in cell C2 shows 3, meaning there are 3 complete years between the two dates.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the "Y" parameter in DATEDIF(A2, B2, "Y") mean?
ACalculate total days between dates
BCalculate complete months between dates
CCalculate complete years between dates
DCalculate difference ignoring years
Key Result
DATEDIF(start_date, end_date, unit) calculates the difference between two dates in specified units like years ("Y"), months ("M"), or days ("D").