ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dates
  3. Calculate Age in Years and Months in Excel

Calculate Age in Years and Months in Excel

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

To show age in years and months in Excel, join two DATEDIF results: =DATEDIF(B2,C2,"Y")&" years, "&DATEDIF(B2,C2,"YM")&" months". "Y" counts whole years and "YM" counts the months left over after those years. Put the birth date first and the end date second, or use TODAY() as the end date for current age.

Key takeaways

  • DATEDIF with "Y" gives whole years; with "YM" it gives the extra months after the last birthday.
  • Join the parts with & to show text like "36 years, 2 months".
  • Use TODAY() as the end date for a current age that updates every day.
  • The start date must come first, or DATEDIF returns #NUM!.
  • For days, =C2-EDATE(B2,DATEDIF(B2,C2,"M")) is safer than the "MD" unit.
On this page+
  1. The formula for age in years and months
  2. What the DATEDIF units mean
  3. How to calculate current age from today's date
  4. How to calculate age on a set date
  5. How to add days to the age
  6. How to get "1 year" instead of "1 years"
  7. Age as numbers instead of text
  8. Common age formula problems
  9. Practise it

To calculate age in years and months in Excel, use DATEDIF twice: once with "Y" for the whole years, and once with "YM" for the months left over. Join the two with & and you get a result like "36 years, 2 months". This guide shows the formula, how to base it on today's date, how to add days, and the mistakes that cause wrong ages.

The formula for age in years and months#

DATEDIF counts the time between two dates in the unit you choose. Its syntax is =DATEDIF(start_date, end_date, unit). For age, the start date is the birth date.

All examples use this sheet, with ages worked out on 2 November 2026:

ABC
1NameBirth dateAs of
2Amira20 Aug 19902 Nov 2026
3Leo15 Mar 20012 Nov 2026
4Hana30 Jan 20102 Nov 2026

In D2, type:

Excel formula
=DATEDIF(B2,C2,"Y")&" years, "&DATEDIF(B2,C2,"YM")&" months"

Amira's result is 36 years, 2 months. Fill down (Windows: Ctrl+D; Mac: ⌘D) and Leo gets 25 years, 7 months, and Hana 16 years, 9 months.

The & joins the numbers and the words into one piece of text. Note the spaces inside the quotes, so the result doesn't read "36years,2months".

What the DATEDIF units mean#

Each unit counts something different. These are the ones you need for age:

UnitCountsAmira's result
"Y"Whole years36
"M"Whole months in total434
"YM"Months left after the whole years2
"D"Days in total13,223
"MD"Days left after the whole months13

Amira turned 36 on 20 August 2026. Two more whole months take her to 20 October, so "YM" is 2. Her next month isn't complete until 20 November, so it doesn't count yet.

DATEDIF is an older function that Excel keeps for compatibility. It works in every version, but Excel doesn't suggest it as you type or show its arguments, so type the whole name yourself. The DATEDIF function guide lists every unit.

How to calculate current age from today's date#

Replace the end date with TODAY(), and the age updates every time the file opens:

Excel formula
=DATEDIF(B2,TODAY(),"Y")&" years, "&DATEDIF(B2,TODAY(),"YM")&" months"

On 2 November 2026 this returns the same 36 years, 2 months for Amira. A month later it shows 3 months. For reports that must not change, such as age at hire date, use a fixed date in a cell instead. The guide to calculating age and years of service covers fixed-date ages in more detail.

How to calculate age on a set date#

Many forms ask for age on a fixed day, such as the end of the year or the start date of a course. Put that date in the formula with DATE, or better, in a cell that everyone can see:

Excel formula
=DATEDIF(B2,DATE(2026,12,31),"Y")&" years, "&DATEDIF(B2,DATE(2026,12,31),"YM")&" months"

On 31 December 2026, Amira is 36 years, 4 months: two more whole months have passed since 20 October. Hana is 16 years, 11 months. Keeping the date in its own cell, such as C1, and pointing every row at $C$1 means you change one cell to recalculate the whole list.

How to add days to the age#

For years, months and days, add a third part. The "MD" unit works for most dates, but Microsoft warns that it can give wrong results in some cases, especially at the end of months. A safer way to count the leftover days is to step forward by whole months with EDATE and subtract:

Excel formula
=DATEDIF(B2,C2,"Y")&" years, "&DATEDIF(B2,C2,"YM")&" months, "&C2-EDATE(B2,DATEDIF(B2,C2,"M"))&" days"

For Amira this returns 36 years, 2 months, 13 days. DATEDIF(B2,C2,"M") is 434 months, EDATE moves 434 months on from her birth date to 20 October 2026, and 2 November minus 20 October is 13 days. Leo shows 18 days and Hana 3 days. For more on stepping dates forward, see how to add days, months and years.

How to get "1 year" instead of "1 years"#

Use IF to pick the singular word when a part equals 1:

Excel formula
=DATEDIF(B2,C2,"Y")&IF(DATEDIF(B2,C2,"Y")=1," year, "," years, ")&DATEDIF(B2,C2,"YM")&IF(DATEDIF(B2,C2,"YM")=1," month"," months")

For a baby born on 1 October 2025, this shows "1 year, 1 month" on 2 November 2026 instead of "1 years, 1 months". It is longer, but it reads naturally on a printed report.

Age as numbers instead of text#

Text like "36 years, 2 months" is easy to read but hard to sort or average. If you need to calculate with ages, keep them as numbers in separate columns:

  • Years: =DATEDIF(B2,C2,"Y") returns 36.
  • Months: =DATEDIF(B2,C2,"YM") returns 2.
  • Total months: =DATEDIF(B2,C2,"M") returns 434. The article on months between dates explains this unit.
  • Decimal years: =YEARFRAC(B2,C2,1) returns about 36.2.

Sorting by total months puts people in exact age order, even when two of them share the same number of years.

Common age formula problems#

Most wrong ages come from the dates, not the formula. Check these:

  1. #NUM! error. The start date is after the end date. Put the birth date first.
  2. An age of 126 years. The birth date cell is empty, so Excel reads it as early 1900. Use =IF(B2="","",your formula) to skip empty rows.
  3. #VALUE! error. The birth date is text, not a real date. Real dates sit on the right of the cell by default; text sits on the left.
  4. The result looks like a date. If you used a single DATEDIF and see something like 05/02/1900, change the cell format to General.

For a simple count of days instead of years and months, see days between two dates.

Practise it#

Date maths shows up in HR, finance and admin tests. Practise days between dates in a live spreadsheet: you work out real gaps between dates with subtraction and DATEDIF, and the lesson checks each formula instantly. Then try the exercise on this page to build the full "years and months" result yourself.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Show Amira's age on C2 as text like 36 years, 2 months. In D2, join DATEDIF with "Y", the text " years, ", DATEDIF with "YM", and the text " months".

fx
ABCDE
1
Name
Birth date
As of
Age
2
Amira
33105
46328
3
Leo
36965
46328
4
Hana
40208
46328
5
6
7

Tip: Use & to join four parts: the years, the text " years, ", the months, and the text " months".

Practise this in a lesson

LessonDays between dates: DAYS, DATEDIF and TODAYMeasure the gap between two dates in days, months and years, and calculate tenure as of today.Function guideDATEDIFCalculate tenure, age and contract length with DATEDIF. Learn every unit (Y, M, D, YM), the hidden-function quirks, and practice live.

Frequently asked questions

How do I calculate age in years and months in Excel?

+

Use =DATEDIF(B2,C2,"Y")&" years, "&DATEDIF(B2,C2,"YM")&" months", with the birth date in B2 and the end date in C2. For today's age, replace C2 with TODAY().

What does YM mean in DATEDIF?

+

"YM" returns the number of whole months between two dates after the complete years are removed. For someone aged 36 years and 2 months, "Y" returns 36 and "YM" returns 2.

How do I calculate age in months only?

+

Use DATEDIF with the "M" unit: =DATEDIF(B2,C2,"M"). It returns the total number of whole months, such as 434 for someone aged 36 years and 2 months.

Why does my age formula show 126 years?

+

The birth date cell is empty, so Excel treats it as day 0 in early 1900. Wrap the formula in IF to skip empty cells: =IF(B2="","",your formula).

Why does DATEDIF return #NUM!?

+

The start date is later than the end date. Put the birth date first and the later date second.

Sources

  • DATEDIF function - Microsoft Support
  • EDATE function - Microsoft Support
  • YEARFRAC function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. The formula for age in years and months
  2. What the DATEDIF units mean
  3. How to calculate current age from today's date
  4. How to calculate age on a set date
  5. How to add days to the age
  6. How to get "1 year" instead of "1 years"
  7. Age as numbers instead of text
  8. Common age formula problems
  9. Practise it

Keep reading

Dates· 6 min read

Add Days, Months or Years to a Date in Excel

To add days to a date in Excel, just add the number: =A2+30. For working days, use =WORKDAY(A2,10). To add months, use =EDATE(A2,3), which handles months of different lengths. To add years, use =EDATE(A2,12*n), for example =EDATE(A2,24) for two years. Use negative numbers to go back in time.

Dates· 6 min read

Calculate Age or Years of Service in Excel

To calculate age in Excel, use =DATEDIF(B2,TODAY(),"Y"), where B2 is the birth date. It counts complete years, so the age only goes up on the birthday. Years of service work the same way with the hire date. For a report that must not change, replace TODAY() with a fixed "as of" date cell.

Dates· 6 min read

How to Calculate Months Between Two Dates

To count the whole months between two dates in Excel, use =DATEDIF(B2,C2,"m") with the start date first. For partial months as a decimal, use =YEARFRAC(B2,C2)*12. To count calendar months regardless of the day, use =(YEAR(C2)-YEAR(B2))*12+MONTH(C2)-MONTH(B2). Each method answers a slightly different question, so pick the one that matches yours.

More on dates

  • Build a Biweekly Pay Schedule in Excel
  • How to Change the Date Format in Excel
  • How to Convert Text to Dates in Excel
  • Convert Time Zones in Excel With a Simple Formula
  • How to Count Dates by Month in Excel
  • DATE, YEAR, MONTH and DAY in Excel
All dates articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free