DATEDIF is a hidden function. It does not appear in the list of functions and Excel does not help you write it, but it is the simplest way to calculate an age or a seniority in whole years or whole months.
The following exercise shows you how to use DATEDIF with its different units.
What you will practice in this exercise
You work on a list of employees with their date of birth and their hire date. You answer 6 questions, one formula per question:
- Age of an employee in whole years (unit “Y”)
- Seniority in whole years (unit “Y”)
- Seniority in whole months (unit “M”)
- Age of another employee in years
- Remaining months after the years (unit “YM”)
- “Senior” or “Junior” based on seniority (IF + DATEDIF)
Practice with exercises
DATEDIF — Age and seniority
Calculate the exact age and seniority of your employees with DATEDIF.
Related articles
All the exercises in this series are based on real cases found on Excel forums. Each one answers a question that Excel users really ask.