Age Calculation Formula: Years, Months and Days Explained
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
- Age in whole years = reference year − birth year, minus 1 if the reference date falls before this year's birthday.
- Exact age adds months and days. When a month or day value comes out negative, borrow from the previous column.
- Age in days is the difference between two dates, which already accounts for leap years and unequal month lengths.
- In Excel, DATEDIF returns completed years, and dividing elapsed days by 365.25 gives a close approximation.
- Always pick the reference date first. "Today" and "on my 18th birthday" give different answers.
Table of Contents
- The basic age formula
- How to calculate exact age in years, months and days
- How to calculate age in days
- Leap years and month lengths
- Calculating age in Excel
- Common mistakes and how to avoid them
- Age in months and weeks by hand
- Perspective
- Calculate your age instantly
- FAQ
- Sources
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)
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
- Write down the date of birth and the reference date.
- Subtract the birth year from the reference year.
- Compare the reference month and day with the birth month and day.
- If the reference month and day come earlier in the calendar year, subtract 1.
- The result is the age in completed years.
Example: birthday already passed
Born March 15, 1990. Reference date: November 8, 2026.
- 2026 − 1990 = 36
- November 8 comes after March 15, so subtract 0.
- Age: 36 years.
Example: birthday not yet reached
Born December 20, 1985. Reference date: November 8, 2026.
- 2026 − 1985 = 41
- November 8 comes before December 20, so subtract 1.
- Age: 40 years.
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
- Subtract the birth date from the reference date in three columns: year, month, day.
- If the day difference is negative, add the number of days in the month before the reference month, and reduce the month difference by 1.
- If the month difference is negative, add 12 and reduce the year difference by 1.
- Read off years, months and days.
Worked example with borrowing
Born December 20, 1985. Reference date: November 8, 2026.
| Unit | Reference | Birth | Raw difference |
|---|---|---|---|
| Year | 2026 | 1985 | 41 |
| Month | 11 | 12 | −1 |
| Day | 8 | 20 | −12 |
- Days are negative (−12). October, the month before November, has 31 days, so days = 31 − 12 = 19, and months drop by 1 to −2.
- Months are negative (−2). Add 12 to get 10, and years drop by 1 to 40.
- Result: 40 years, 10 months, 19 days.
Worked example without borrowing
Born March 15, 1990. Reference date: November 8, 2026.
- Years: 2026 − 1990 = 36
- Months: 11 − 3 = 8
- Days: 8 − 15 = −7, so borrow: October has 31 days, so 31 − 7 = 24 days and months become 7.
- Result: 36 years, 7 months, 24 days.
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:
- Weeks = days ÷ 7
- Hours = days × 24
- Minutes = days × 1,440
- Seconds = days × 86,400
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.
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:
=YEARFRAC(A2, TODAY())returns the fractional years between two dates.- Dividing elapsed days by 365.25 gives an approximate age that accounts for the average length of a year across the leap cycle.
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
- Skipping the birthday check. Subtracting years alone overstates age until the birthday arrives.
- Mixing date formats. In the U.S., 03/04/2026 means March 4. Elsewhere it often means April 3. Confirm the order of month and day before you calculate.
- Using 30 days for every month. Borrow the real length of the month.
- Forgetting the reference date. Age "at enrollment" or "at death" needs that date, not today's.
- Counting inclusively by accident. Subtracting dates gives elapsed days. If you want to count both the first and last day, add 1.
- Ignoring time zones for day counts. Someone born near midnight can be a day older or younger depending on the zone you use.
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.
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
- Calculate age | Microsoft Support
- Method to determine whether a year is a leap year | Microsoft Learn
- Calculate the difference between two dates | Microsoft Support
- Get age from birthday | Exceljet
- How to find out the ages of people using Excel | Online Journalism Blog