Excel + Google Sheets · DATEDIF
Excel's hidden formula
Counts full years, months or days between two dates. It's not in the menu, but it works.
The formula
=DATEDIF(B2, TODAY(), "y")What each part means
B2Start dateTODAY()End date"y"Unit: years ("m" months, "d" days)
Example
TODAY: NOV 2, 2026
| A | B | C | |
|---|---|---|---|
| 1 | Employee | Start date | Years |
| 2 | Laura | 2019-03-15 | |
| 3 | João | 2022-11-20 | |
| 4 | Priya | 2025-01-07 | |
| 5 | Tom | 2010-06-01 |
| A | B | C | |
|---|---|---|---|
| 1 | Employee | Start date | Years |
| 2 | Laura | 2019-03-15 | 7 |
| 3 | João | 2022-11-20 | 3 |
| 4 | Priya | 2025-01-07 | 1 |
| 5 | Tom | 2010-06-01 | 16 |
Step by step
- Click cell C2.
- Type the formula:
=DATEDIF(B2, TODAY(), "y") - Press Enter.
- Drag the small square in the bottom-right corner of the cell down to copy it to the other rows.
Where it works
- Every version of Excel
- Google Sheets
- Excel for the web (free)