Technical & Developer Tools
Excel Age Formula Generator
Generate DATEDIF and YEARFRAC spreadsheet age formulas.
The code returns for the sample
- Generated code
Step-by-step working
- Sample: 2000-03-10 → 2026-11-29
- Expected result: 26
- 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.
- Enter the birth date cell: Type the cell that holds the birth date, such as A2.
- Choose the reference: Use TODAY() for current age, or a cell such as B2 for a fixed date.
- Pick the output: Choose years, years and months, full Y-M-D text, total days or decimal years.
- 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
| Symbol | Meaning |
|---|---|
"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 1 | YEARFRAC 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.
=DATEDIF(A2,B2,"Y")→ 26=DATEDIF(A2,B2,"YM")→ 8=DATEDIF(A2,B2,"MD")→ 15=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:
| Formula | Returns | Result |
|---|---|---|
=DATEDIF(A2,B2,"Y") | Completed years | 26 |
=DATEDIF(A2,B2,"M") | Completed months | 320 |
=DATEDIF(A2,B2,"D") | Total days | 9,756 |
=DATEDIF(A2,B2,"YM") | Months after last birthday | 8 |
=DATEDIF(A2,B2,"MD") | Days after last month-day | 15 |
=INT(YEARFRAC(A2,B2,1)) | Completed years | 26 |
=B2-A2 | Total days | 9,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.
Related Technical & Developer Tools Tools
Time Zone Aware Age Calculator
Compare birth and reference timestamps across global time zones.
Unix Birth Timestamp Age Calculator
Calculate elapsed age from seconds-since-epoch Unix timestamps.
ISO 8601 Birth Date Age Calculator
Calculate age from standard ISO 8601 date-time strings.
Birth Date Validator
Check date validity, leap day legality, and future date errors.
Google Sheets Age Formula Generator
Generate cloud spreadsheet formulas for birth-date age tracking.
SQL Age Query Generator
Generate age calculation SQL queries for PostgreSQL, MySQL, and SQLite.