Age Calculation Formula: Years, Months and Days Explained

Published by the MetriqaHub Editorial Team on November 8, 2026.

Age Calculation Formula: Years, Months and Days Explained

Age Calculation Formula: Years, Months and Days Explained

Woman calculating age from calendar dates

To calculate age from a date of birth, subtract the birth year from the reference year, then subtract 1 if the birthday has not happened yet in the reference year. For an exact age, work out the leftover months and days too. For age in days, count the days between the two dates. Below are the formulas, worked examples and the edge cases that trip people up. If you just want the answer, our age calculator does all of it instantly.

TL;DR

Table of Contents

The basic age formula

Every age calculation starts with two dates: the date of birth and a reference date. The reference date is usually today, but it can be any date in the past or future, such as the day you start school, apply for a license or retire.

The core formula is:

age = reference year − birth year − (1 if the reference date is before the birthday, otherwise 0) The basic age formula

A published walkthrough on calculating ages states the same rule: subtract one when the reference month and day come before the birth month and day. Programmers use the same logic. They compare the (month, day) pair of the reference date with the (month, day) pair of the birth date.

Step by step

Example: birthday already passed

Born March 15, 1990. Reference date: November 8, 2026.


Example: birthday not yet reached

Born December 20, 1985. Reference date: November 8, 2026.


This second case is the most common source of mistakes. The year subtraction alone overstates the age by one until the birthday arrives.

How to calculate exact age in years, months and days

Whole years are rarely enough for forms, medical records or milestone tracking. For an exact age, you subtract each unit separately: years, then months, then days. When a unit goes negative, you borrow from the next larger unit, the same way you do in written subtraction.

The method

Worked example with borrowing

Born December 20, 1985. Reference date: November 8, 2026.

UnitReferenceBirthRaw difference
Year2026198541
Month1112−1
Day820−12
You can check it by counting forward. December 20, 2025 is the last birthday. Ten months later is October 20, 2026. Nineteen more days reaches November 8, 2026.

Worked example without borrowing

Born March 15, 1990. Reference date: November 8, 2026.


Which month do you borrow from?

The convention is to borrow the length of the month immediately before the reference month. Different tools sometimes borrow differently, so two calculators can disagree by a day or two when a birth date sits near the end of a month, such as the 31st. The years and total days stay the same. Only the months-and-days split can shift.

How to calculate age in days

Counting days sidesteps the borrowing problem entirely. You simply count how many calendar days lie between the birth date and the reference date.

By hand, that means adding the days in each full year, accounting for leap years, then the days in the partial years. It is tedious and easy to get wrong, so most people use a date function. In Excel, Microsoft documents that the DAYS function calculates the number of days between two dates, and DAYS(TODAY(), birth-date) returns the elapsed days up to today.

For the March 15, 1990 example, the gap to November 8, 2026 is 13,387 days. For the December 20, 1985 example it is 14,933 days.

To count days between any two dates, including future ones, use our days between dates calculator. If you only need working days, see our guide to calculating business days.

Converting days to weeks, hours and minutes

Once you have days, the rest is multiplication:


These are approximate for "right now" because they ignore the time of day you were born. For an exact figure down to the minute you need the birth time and a time zone.

Leap years and month lengths

Two calendar quirks affect every age calculation.

Month lengths vary. Months have 28, 29, 30 or 31 days. That is why the borrowing step needs the length of a specific month, not a flat 30. Leap years add a day. In the Gregorian calendar, a leap year is any year divisible by 4, except century years, which must also be divisible by 400. So 2000 and 2024 were leap years, while 1900 was not and 2100 will not be. Month lengths and Gregorian leap-year rule

Born on February 29

People born on a leap day have a real birthday only every fourth year. Calculation rules still work: in a non-leap year, February 29 never occurs, so the birthday is treated as falling on either February 28 or March 1 depending on the convention of the system or the legal jurisdiction. For legal purposes such as driving or voting eligibility, check the rule of the state or country in question. The elapsed-days method is unaffected. Someone born February 29, 2000 has lived 9,749 days by November 8, 2026.

Calculating age in Excel

Excel has no single "age" function, but three approaches cover most needs.

Completed years with DATEDIF

DATEDIF returns whole units between two dates. With a birth date in cell A2:

=DATEDIF(A2, TODAY(), "Y")

This applies the "subtract one if the birthday has not happened" rule for you. Exceljet describes DATEDIF as a compatibility function inherited from Lotus 1-2-3 that still works in modern Excel.

Years, months and days in one cell

Microsoft's guidance is to use DATEDIF for completed years and remaining months, then calculate the remaining days by subtracting the first day of the last month from the end date, combining the three parts in a single cell. A common layout is:

=DATEDIF(A2,TODAY(),"Y") & " years, " & DATEDIF(A2,TODAY(),"YM") & " months, " & (TODAY()-DATE(YEAR(TODAY()),MONTH(TODAY()),1)) & " days"

The & operator joins the numbers and the text labels, which is how you get a readable result such as "38 years, 1 month, 14 days", as Exceljet explains.

The days part above is only exact when the birth day-of-month is the 1st. For the general case, the safer approach is to find the date one whole month-step after the last completed month and subtract it from the end date, or to use our calculator. Microsoft also warns against the "MD" unit in DATEDIF because it can return inaccurate results in some month-end cases, so avoid it for the days value.

Approximate age with a decimal

Two quick options appear in Microsoft's age guide:


For the March 15, 1990 example, 13,387 ÷ 365.25 is about 36.65 years. Use the decimal for statistics or rough comparisons. For a legal or medical age, use completed years.

The shortcut to avoid

Subtracting years alone, such as =YEAR(TODAY())-YEAR(A2), ignores whether the birthday has passed, so it is wrong for part of every year. Dividing days by a flat 365 drifts by about a day every four years, so it can show the wrong age close to a birthday.

Common mistakes and how to avoid them

Age in months and weeks by hand

Months: multiply completed years by 12 and add the remaining months. Born December 20, 1985, 40 years and 10 months is 490 months as of November 8, 2026.

Weeks: divide total days by 7. 14,933 ÷ 7 is 2,133 weeks with 2 days left over.

For related arithmetic such as turning decimals into clean figures, our rounding calculator helps, and for working out time between clock times, try the time duration calculator.

Perspective

Age looks like the simplest calculation there is, and that is exactly why it goes wrong so often. The error is rarely in the arithmetic. It is in the unstated choices: which reference date, which month length to borrow, whether the birthday has passed.
>
We build our tools around that idea. A calculator should show its inputs plainly, accept any reference date and return years, months and days at once, so you can see the answer and trust it. Our calculators are free, need no registration and give results immediately, and we design them to follow internationally recognized standards for dates and units.
>
Our advice: learn the formula once, because it makes every result easier to sanity-check, then let a tool do the repetitive work. Use the manual method for a single date and a calculator whenever the answer matters.
>
Nkosi

Calculate your age instantly

If you would rather skip the borrowing and the spreadsheet formulas, enter your date of birth into our age calculator. It returns your exact age in years, months and days for today or any other date, with no sign-up.

Metriqahub

For related date tasks, browse all our time and date calculators, or explore the rest of MetriqaHub's calculators and guides, including finance calculators for loans and savings.

FAQ

How do I calculate my age from my date of birth?

Subtract your birth year from the current year. If your birthday has not yet occurred this year, subtract 1. For example, someone born December 20, 1985 is 40 on November 8, 2026. To get months and days as well, subtract month and day separately and borrow where a value is negative.

How many days old am I?

Count the days between your birth date and today. In Excel, =DAYS(TODAY(), A2) with your birth date in A2 returns it, as Microsoft's age guide describes. Someone born March 15, 1990 is 13,387 days old on November 8, 2026. Our days between dates calculator gives the same count without a spreadsheet.

Why do two age calculators sometimes give different months and days?

The whole years and the total day count should match. The months-and-days split can differ because tools borrow from different months when the birth day is later in the month than the reference day. Birth dates on the 29th, 30th or 31st are the usual cause.

Is dividing days by 365.25 accurate?

It is a good approximation of age as a decimal because 365.25 reflects the average year length over the leap cycle, as Microsoft notes. It is not a substitute for completed years or an exact years-months-days result when a precise age is required.

How is age counted for someone born on February 29?

The elapsed-days count is exact regardless. For the age in years, the birthday in non-leap years is treated as February 28 or March 1, depending on the convention or the law that applies. For legal age thresholds, check the rule for your state or country.

Sources

Recommended

More articles

Work the numbers yourself

Our money guides go through home equity and student loan decisions in full, with calculators and every rule cited to its source.

Browse the money guides

General information, not financial advice. See our editorial standards.

Age Calculation Formula: Years, Months and Days Explained