Premium exercise · Excel text and date functions
DATEDIF practice: years of service
Practice Excel DATEDIF by calculating completed years of service between a start date and an as-of date.
Column A is the hire date and column B is the as-of date. Count only completed years.
In column C, use DATEDIF with the unit Y. A hire date of June 15 has not completed another year on June 14.
Dataset
Starter sheet. Cells marked formula are where the formula goes.
| Row | A | B | C |
|---|---|---|---|
| 1 | Hired | As of | Years |
| 2 | 2019-01-01 | 2024-01-01 | Formula goes in C2. formula |
| 3 | 2020-06-15 | 2024-06-14 | Formula goes in C3. formula |
| 4 | 2021-08-01 | 2024-09-01 | Formula goes in C4. formula |
Hint
DATEDIF takes a start date, an end date, and a unit in quotes. Y means completed years.
Explanation
This exercise practices DATEDIF in Excel. The formula goes in C2, C3, C4.
DATEDIF with Y counts anniversaries that have already happened. 2019-01-01 to 2024-01-01 is 5 years. The June 15 hire reaches only 3 years by June 14, and the August hire has completed 3 years by September.
The interactive sheet and a worked solution are part of Formula Drills Premium. The instructions and starter data on this page are the full problem.