ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 62 · Dates

DATEDIF: ages in Excel

DATEDIF counts the full years, months or days between two dates. =DATEDIF(B2,$F$1,"Y") gives someone’s age on the date in F1.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Find an age in years with DATEDIF
  • Count full months between dates

How it works

=DATEDIF(B2,$F$1,"Y") counts full years from the birthday to the date in F1.

Lock F1 with $ so every row uses the same date.

Formulas at a glance

=DATEDIF(start,end,"Y")years
=DATEDIF(start,end,"M")months

Example

Write the formula to find Ana's age on the date in F1.

ABCDEF
1NameBirthdayAgeMonths oldAs of6/1/2026
2Ana4/12/2014
3Ben11/3/2013
4Cleo7/28/2014
5Dev1/9/2015
6
7Gus9/9/2014

Click C2 and type =DATEDIF(B2,$F$1,"Y"), then press Enter.

The answer is 12.

When to use it

  • Ages from birthdays
  • Years of service
  • Full months between two dates

Common mistakes

  • The start date after the end dateDATEDIF shows #NUM!. Put the earlier date first.
  • Forgetting the quotes on "Y"The unit goes in quotes.
  • Not finding it in the function listDATEDIF is hidden from the list, but it works when you type it.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

DATEDIF: ages in Excel: how it works, with examples · ExcelUnpack