How to calculate age in Excel: DATEDIF, YEARFRAC and the “/365” mistake
Calculate age from a date of birth in Excel accurately: DATEDIF, YEARFRAC, length of service in years and months, next birthday, and why (today − date)/365 gets it wrong.
HR tracks employees’ ages, length of service and time left until retirement; a school admits children who are 6 by September 1; a bank checks whether a customer is over 18. Each time the question is the same: how many full years lie between two dates?
The first formula that comes to mind — =(TODAY-Birth date)/365 — adds a year a few days before the birthday, because it ignores leap years. The right tool is the DATEDIF function.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Employee | Date of birth | Age | /365 method | As of | |
| 2 | Aziz Karimov | 15.03.1990 | 35 | 35 | 01.11.2025 | |
| 3 | Dilnoza Rakhimova | 02.11.2000 | 24 | 251 | ||
| 4 | Javokhir Turaev | 29.02.1996 | 29 | 29 | ||
| 5 | Malika Yusupova | 01.11.1985 | 40 | 40 | ||
| 6 | Sardor Aliev | 20.07.2007 | 18 | 18 | ||
| 7 |
Method 1: DATEDIF — full years
1
Put the “as of” date in its own cell (E2). For the current day use =СЕГОДНЯ(); for a report, a fixed date (e.g. 01.11.2025) is better — the result won’t shift when someone opens the file tomorrow.
2
Type =РАЗНДАТ(B2;$E$2;"Y") in C2. The first argument is the start date (birth date), the second is the end date, the third is the unit: "Y" means full years.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Employee | Date of birth | Age | As of | ||
| 2 | Aziz Karimov | 15.03.1990 | 352 | 01.11.2025 | ||
| 3 | Dilnoza Rakhimova | 02.11.2000 | ||||
| 4 | Javokhir Turaev | 29.02.1996 | ||||
| 5 |
3
As you type, Excel doesn’t suggest DATEDIF or show its arguments — it is a “hidden” function kept for Lotus 1-2-3 compatibility. Don’t worry: typed in full, it works in every version.
4
Fill the formula down. Because $E$2 is locked, every row is measured against the same date.
Method 2: YEARFRAC — age with decimals
1
=ДОЛЯГОДА(B2;$E$2;1) returns the years between two dates with a fractional part: 35.63 for Aziz. The third argument 1 means counting days on the actual calendar (leap years included).
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Employee | Date of birth | YEARFRAC | Full years | As of | |
| 2 | Aziz Karimov | 15.03.1990 | 35,63 | 35 | 01.11.2025 | |
| 3 | Dilnoza Rakhimova | 02.11.2000 | 25,00 | 24 | ||
| 4 | Javokhir Turaev | 29.02.1996 | 29,67 | 29 | ||
| 5 |
2
For full years: =ЦЕЛОЕ(ДОЛЯГОДА(B2;$E$2;1)). Fractional age is handy for averages and charts; for the official age on documents, DATEDIF is the safer choice.
Method 3: “35 yrs 7 mos” — for length of service
1
Other DATEDIF units: "M" — full months, "D" — days, "YM" — months left over after full years. Join them with text: =РАЗНДАТ(B2;$E$2;"Y")&" yrs "&РАЗНДАТ(B2;$E$2;"YM")&" mos".
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Employee | Hired | Service | As of | |
| 2 | Aziz Karimov | 01.09.2018 | 7 yrs 2 mos | 01.11.2025 | |
| 3 | Dilnoza Rakhimova | 15.08.2019 | 6 yrs 2 mos | ||
| 4 | Javokhir Turaev | 10.06.2015 | 10 yrs 4 mos | ||
| 5 |
Pro level: next birthday, age on a given date and age bands
- Next birthday:
=ДАТАМЕС(B2;12*(C2+1))adds (age+1)×12 months to the birth date. It also works for people born on February 29: in a non-leap year it returns February 28. Days to go:=ДАТАМЕС(B2;12*(C2+1))-$E$2. - Age on a specific date: school admission as of September 1:
=РАЗНДАТ(B2;ДАТА(2025;9;1);"Y")>=6. You get TRUE/FALSE — handy for filtering. - Age bands (for reports and PivotTables):
=ЕСЛИМН(C2<25;"under 25";C2<35;"25–34";C2<45;"35–44";ИСТИНА;"45+"). - Average age:
=СРЗНАЧ(C2:C6)uses full years; for more precision, average the YEARFRAC column.
Try it in the simulator
Column B holds birth dates and E1 the “as of” date (the simulator shows them as serial numbers). Type =РАЗНДАТ(B2;$E$1;"Y") in C2 and fill down to C6. Then type =ЦЕЛОЕ((E$1-B2)/365) in D2, fill down and find the row where the results differ.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Employee | Date of birth | DATEDIF | /365 | 45962 | |||||||||||||||||||
| 2 | Aziz Karimov | 32947 | ||||||||||||||||||||||
| 3 | Dilnoza Rakhimova | 36832 | ||||||||||||||||||||||
| 4 | Javokhir Turaev | 35124 | ||||||||||||||||||||||
| 5 | Malika Yusupova | 31352 | ||||||||||||||||||||||
| 6 | Sardor Aliev | 39283 | ||||||||||||||||||||||
| 7 | ||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.