The YEAR function
YEAR pulls the year out of a date as an ordinary number, like 2025. That makes it easy to total sales by year, label rows, or compare two dates' years.
It needs a real date. Text that only looks like a date may not work, so check the cell first.
=YEAR(serial_number)
Arguments
- serial_number
- The date (or cell holding a date) to take the year from.
Try it
=YEAR(A2) in C2. 14 March 2025 is in 2025.
C2
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order date | Amount | Year | |
| 2 | 14 Mar 2025 | £240 | 2025 | |
| 3 | 2 Nov 2024 | £95 | ||
| 4 | 27 Jan 2025 | £410 | ||
| 5 | 14th March 2025 | |||
| 6 | ||||
| 7 |
Edit the formula in C2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =YEAR(A2)-YEAR(A3) | 1 | The difference between the years, ignoring months and days. |
| ="FY"&YEAR(A4) | FY2025 | Build a label from the year. |
| =SUMPRODUCT((YEAR(A2:A4)=2025)*B2:B4) | 650 | Total the 2025 orders: £240 + £410. |
| =YEAR(A5) | #VALUE! | "14th March 2025" is text, not a date, so YEAR can't read it. |
Tips
- Combine with DATE to move to a fixed day in the same year:
=DATE(YEAR(A2),12,31)is that year's last day. - For an exact age or length of service, use DATEDIF rather than subtracting years, which ignores whether the birthday has passed.
- Format the result cell as a plain number, not a date.
Common mistakes
- YEAR shows 1905 or a date.The result cell has a date format. Change it to General or Number.
- YEAR returns #VALUE!.The cell holds text that looks like a date. Convert it with DATEVALUE, or rebuild it with DATE.
- YEAR(B2)-YEAR(A2) says someone is 30 when they're 29.That only compares the years. Use
DATEDIF(A2,B2,"Y")for whole years.
Practise YEAR with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.