Example 1
Read the year from a date
B2 =YEAR(A2)
Result: 2025
YEAR returns the year part as a plain number.
B2 =YEAR(A2) returns 2025
Returns the year of a date as a four-digit number between 1900 and 9999.
Syntax
=YEAR()
All versions of Excel.
Try it
Edit the formula in B2 or change the inputs. The sheet recalculates as you type.
B2 =YEAR(A2) returns 2025
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.
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)).
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!.
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.
=YEAR(TODAY())-YEAR(A2) is only an approximation, because it ignores whether the birthday has happened. DATEDIF with "y" is exact.=DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)).=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.
"2025-03-15". Dates entered as plain text in an unreadable format return #VALUE!.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
B2 =YEAR(A2)
Result: 2025
YEAR returns the year part as a plain number.
B2 =YEAR(A2) returns 2025
Example 2
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 =YEAR(A2) returns 2024
Example 3
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 =YEAR(A2)+(MONTH(A2)>6) returns 2026
Example 4
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 =SUMPRODUCT(--(YEAR(A2:A6)=2025)) returns 3
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.
=IF(A2="","",YEAR(A2)).#VALUE!. Convert it with DATEVALUE, or use Data, Text to Columns, before using YEAR.=YEAR(TODAY())-YEAR(A2) counts the birthday as passed even in January. Use DATEDIF(A2,TODAY(),"y").Use `=YEAR(A2)`, where A2 holds the date. The result is a four-digit number such as 2025.
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))`.
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.
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.
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.
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.