Skip to main content
Calculate Age From Date Of Birth
Calculate Age From Date Of Birth
Exact Age Calculator

Technical & Developer Tools

Excel Age Formula Generator

Generate DATEDIF and YEARFRAC spreadsheet age formulas.

Excel Age Formula Generator Inputs

Return

The code returns for the sample26

Generated code
=DATEDIF(A2,TODAY(),"Y") Decimal years: =YEARFRAC(A2,TODAY(),1)
Step-by-step working
  1. Sample: 2000-03-10 → 2026-11-29
  2. Expected result: 26
  3. DATEDIF is undocumented in Excel but supported in every version since Excel 2000.

What Is the Excel Age Formula Generator?

An Excel Age Formula Generator is a tool that writes ready-to-paste Microsoft Excel formulas that calculate age from a birth date cell, using DATEDIF, YEARFRAC and TODAY.

Excel has no AGE function. The standard formula is =DATEDIF(A2,TODAY(),"Y"), which returns completed years for a birth date in cell A2. DATEDIF is a legacy function that Excel supports but does not list in its function wizard.

The generator builds formulas for years, years-and-months, total days and decimal years, with the birth cell and the "as of" cell set by the user.

How Does the Excel Age Formula Generator Work?

The Excel Age Formula Generator works by inserting the user’s cell references into tested DATEDIF and YEARFRAC templates.

  1. Enter the birth date cell: Type the cell that holds the birth date, such as A2.
  2. Choose the reference: Use TODAY() for current age, or a cell such as B2 for a fixed date.
  3. Pick the output: Choose years, years and months, full Y-M-D text, total days or decimal years.
  4. Copy the formula: Paste it into the first row and fill down.

Excel Age Formula Generator Formula

The core Excel age formula is =DATEDIF(A2,TODAY(),"Y"), which returns completed years.

=DATEDIF(A2,TODAY(),"Y")&" years, "&DATEDIF(A2,TODAY(),"YM")&" months, "&DATEDIF(A2,TODAY(),"MD")&" days"

  • =INT(YEARFRAC(A2,TODAY(),1)) → completed years
  • =TODAY()-A2 → total days (format the cell as Number)
  • =YEARFRAC(A2,TODAY(),1) → decimal years, actual/actual basis
Variables in the Excel Age Formula Generator formula
SymbolMeaning
"Y"Completed years
"YM"Months after the last full year
"MD"Days after the last full month (Microsoft warns that "MD" can return wrong values near month ends)
basis 1YEARFRAC actual/actual day count

Excel Age Formula Generator Example

Cell A2 holds 2000-03-10 and cell B2 holds 2026-11-25. Compute the age.

  1. =DATEDIF(A2,B2,"Y") → 26
  2. =DATEDIF(A2,B2,"YM") → 8
  3. =DATEDIF(A2,B2,"MD") → 15
  4. =B2-A2 → 9,756

Excel returns 26 years, 8 months, 15 days.

Excel Age Formula Generator Conversion Table

The table lists 7 Excel formulas and what each returns for a birth date of 2000-03-10 and a reference date of 2026-11-25:

Excel age formulas and their results for A2 = 2000-03-10, B2 = 2026-11-25
FormulaReturnsResult
=DATEDIF(A2,B2,"Y")Completed years26
=DATEDIF(A2,B2,"M")Completed months320
=DATEDIF(A2,B2,"D")Total days9,756
=DATEDIF(A2,B2,"YM")Months after last birthday8
=DATEDIF(A2,B2,"MD")Days after last month-day15
=INT(YEARFRAC(A2,B2,1))Completed years26
=B2-A2Total days9,756

Excel stores dates as serial numbers from January 1, 1900, so subtracting 2 dates gives days.

What Are the Uses of the Excel Age Formula Generator?

The Excel Age Formula Generator has 4 main uses: HR sheets, school rosters, membership lists and finance models.

  • HR sheets: HR staff add an age column to employee lists.
  • School rosters: Teachers compute student ages on a cutoff date in B1.
  • Membership lists: Clubs find members who turn 65 this year.
  • Finance models: Analysts use YEARFRAC for age-based pension models.

Excel Age Formula Generator FAQ

Why does Excel not show DATEDIF in the function list?

Excel keeps DATEDIF for compatibility with Lotus 1-2-3 and does not list it in the function wizard. The function still works when typed.

How do I calculate age on a specific date in Excel?

Calculate age on a specific date in Excel with =DATEDIF(A2,DATE(2026,12,31),"Y"), replacing the date with the one needed.

Written and reviewed by Iqbal Hussain. Last reviewed. Calendar rules and sources: methodology.