Skip to content

YEAR

Returns the year of a date as a four-digit number between 1900 and 9999.

Syntax

=YEAR()

Date and time

All versions of Excel.

Try it

Edit the formula in B2 or change the inputs. The sheet recalculates as you type.

B2
A
B
C
1
Invoice date
Year
2
15-Mar-2025
2025
3

B2 =YEAR(A2) returns 2025

How YEAR works

YEAR reads a date and returns its year as a four-digit number: =YEAR(A2) with 15 March 2025 in A2 returns 2025. It is one of three companions, with MONTH and DAY, that take a date apart so you can group, filter or rebuild it with DATE.

The one argument

serial_number is the date. Normally that is a cell reference. You can also nest a function, as in =YEAR(TODAY()), or give text that Excel recognises as a date. ISO text such as "2025-03-15" is read the same way on every machine. Text such as "3/4/2025" depends on regional settings, which makes it risky.

If the cell holds text that only looks like a date, YEAR returns #VALUE!. A blank cell counts as 0, which Excel reads as 0 January 1900, so =YEAR(A2) on an empty A2 returns 1900, not an error. Guard against that with =IF(A2="","",YEAR(A2)).

Grouping by year

YEAR is the usual helper column for yearly summaries. Put =YEAR(A2) next to each transaction, then total with SUMIFS on that column. Without a helper column, SUMPRODUCT((YEAR(A2:A500)=2025)*C2:C500) does the same in one cell. Neither approach works if YEAR can't read some of the dates, because one text date turns the whole SUMPRODUCT into #VALUE!.

Financial and fiscal years

A fiscal year that ends in June, labelled by the year it ends in, is =YEAR(A2)+(MONTH(A2)>6). Dates from July onward belong to the next fiscal year's label. A year that starts in April can be labelled by shifting the date first: =YEAR(EDATE(A2,-3)) places January to March in the previous label.

Related patterns

  • Age in years: =YEAR(TODAY())-YEAR(A2) is only an approximation, because it ignores whether the birthday has happened. DATEDIF with "y" is exact.
  • Same date next year: =DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)).
  • Is it a leap year: =DAY(DATE(YEAR(A2),3,0))=29.

YEAR returns a plain number, so the result needs no date format. If a cell shows a date-like value after you enter YEAR, format it as General.

Arguments

serial_number
The date to read: a cell holding a date, a date built with DATE, or text Excel can read as a date, such as "2025-03-15". Dates entered as plain text in an unreadable format return #VALUE!.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Read the year from a date

B2 =YEAR(A2)

Result: 2025

YEAR returns the year part as a plain number.

B2
A
B
C
1
Invoice date
Year
2
15-Mar-2025
2025
3

B2 =YEAR(A2) returns 2025

Example 2

Year from ISO text

B2 =YEAR(A2)

Result: 2024

A2 holds text in year-month-day order. Excel reads that format the same way in every region, so YEAR converts it.

B2
A
B
C
1
Date as text
Year
2
2024-11-30
2024
3

B2 =YEAR(A2) returns 2024

Example 3

Fiscal year label for a year ending in June

B2 =YEAR(A2)+(MONTH(A2)>6)

Result: 2026

September 2025 falls in the year that ends in June 2026. The comparison MONTH(A2)>6 returns TRUE, which adds 1 to the year.

B2
A
B
C
1
Posting date
FY (ends June)
2
12-Sep-2025
2026
3

B2 =YEAR(A2)+(MONTH(A2)>6) returns 2026

Example 4

Count transactions in one year

D2 =SUMPRODUCT(--(YEAR(A2:A6)=2025))

Result: 3

YEAR runs on every date in the range at once. Comparing each year with 2025 gives TRUE or FALSE, and the double minus turns those into 1 and 0 for SUMPRODUCT to add.

D2
A
B
C
D
1
Order date
Amount
Orders in 2025
2
28-Dec-2024
420
3
3
09-Jan-2025
135
4
22-Apr-2025
980
5
03-Nov-2025
260
6
05-Jan-2026
540
7

D2 =SUMPRODUCT(--(YEAR(A2:A6)=2025)) returns 3

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B2, return the year each person was hired. Fill it down to B4.

Answer in B2, then it fills down to B4.

B2
A
B
C
D
E
1
Hire date
Hire year
Fiscal year (ends June)
2
17-Apr-2023
3
03-Oct-2022
4
29-Jan-2024
5

Common mistakes

  • A blank cell returns 1900, not an error, because Excel treats an empty cell as 0. Wrap it: =IF(A2="","",YEAR(A2)).
  • Text that merely looks like a date returns #VALUE!. Convert it with DATEVALUE, or use Data, Text to Columns, before using YEAR.
  • Subtracting years doesn't give an age. =YEAR(TODAY())-YEAR(A2) counts the birthday as passed even in January. Use DATEDIF(A2,TODAY(),"y").
  • Applying a date format to the result of YEAR shows a date in 1905, because 2025 is read as a serial number. YEAR returns a plain number, so format the cell as General or Number.

Questions people ask

How do I get the year from a date in Excel?

Use `=YEAR(A2)`, where A2 holds the date. The result is a four-digit number such as 2025.

Why does YEAR return 1900?

The cell it points at is empty, and Excel treats an empty cell as 0, which is read as the date 0 January 1900. Test for blanks first with `=IF(A2="","",YEAR(A2))`.

Why does YEAR return #VALUE!?

The cell holds text that Excel can't read as a date. Check for stray spaces, a day-first date typed in a month-first region, or a leading apostrophe. DATEVALUE and Text to Columns can convert it.

How do I sum values by year?

Add a helper column with `=YEAR(A2)` and use SUMIFS on it. Without a helper column, use SUMIFS with a date range: sum where the date is at least 1 January and before 1 January of the next year.

How do I get a fiscal year from a date?

It depends on the start month. For a year ending in June, labelled by the end year, use `=YEAR(A2)+(MONTH(A2)>6)`. For a year starting in April, `=YEAR(EDATE(A2,-3))` gives the starting year.

Learn YEAR in a real sheet.

YEAR is taught in Dates and financial modelling, lesson 2: Building and splitting dates. Each lesson is a short, graded exercise like the one above.