FxFormula Drills

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.

Starter sheet for this exercise
RowABC
1HiredAs ofYears
22019-01-012024-01-01Formula goes in C2. formula
32020-06-152024-06-14Formula goes in C3. formula
42021-08-012024-09-01Formula 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.

Solve this exercise

Practice this formula

Loading the practice grid…