Intermediate

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.

Книга1 - Excel
—☐✕
C3fx=РАЗНДАТ(B3;$E$2;"Y")
ABCDEF
1EmployeeDate of birthAge/365 methodAs of
2Aziz Karimov15.03.1990353501.11.2025
3Dilnoza Rakhimova02.11.200024251
4Javokhir Turaev29.02.19962929
5Malika Yusupova01.11.19854040
6Sardor Aliev20.07.20071818
7
Готово
Dilnoza’s birthday is tomorrow — she is still 24. The /365 method says 25

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.

Книга1 - Excel
—☐✕
C2fx=РАЗНДАТ(B2;$E$2;"Y")
ABCDEF
1EmployeeDate of birthAgeAs of
2Aziz Karimov15.03.199035201.11.2025
3Dilnoza Rakhimova02.11.2000
4Javokhir Turaev29.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).

Книга1 - Excel
—☐✕
C2fx=ДОЛЯГОДА(B2;$E$2;1)
ABCDEF
1EmployeeDate of birthYEARFRACFull yearsAs of
2Aziz Karimov15.03.199035,633501.11.2025
3Dilnoza Rakhimova02.11.200025,0024
4Javokhir Turaev29.02.199629,6729
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".

Книга1 - Excel
—☐✕
C2fx=РАЗНДАТ(B2;$D$2;"Y")&" yrs "&РАЗНДАТ(B2;$D$2;"YM")&" mos"
ABCDE
1EmployeeHiredServiceAs of
2Aziz Karimov01.09.20187 yrs 2 mos01.11.2025
3Dilnoza Rakhimova15.08.20196 yrs 2 mos
4Javokhir Turaev10.06.201510 yrs 4 mos
5
Готово
Length of service in years and months — ready-made text for orders and certificates

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.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1EmployeeDate of birthDATEDIF/36545962
2Aziz Karimov32947
3Dilnoza Rakhimova36832
4Javokhir Turaev35124
5Malika Yusupova31352
6Sardor Aliev39283
7
8
9
10
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

148 / 154