# YEAR function in Excel

> YEAR returns the four-digit year from a date.

Source: https://spreadsheetpractice.com/functions/year · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** YEAR returns the four-digit year from a date.
- **Syntax:** `=YEAR(serial_number)`
- **Most common use:** `=YEAR(B2)` returns 2025 (The year of the first invoice)
- **Available in:** Every current version
- **Category:** [Date functions](https://spreadsheetpractice.com/functions/category/date)
- **Returns:** A whole number such as 2026.
- **Google Sheets:** Works the same in Google Sheets.

## What it does

YEAR returns the four-digit year from a date. It is the quickest way to group transactions by year, check which year a date falls in, or build a year column for a pivot table or SUMIFS report.

## Syntax

`=YEAR(serial_number)`

| Argument | Required? | What it is |
|---|---|---|
| `serial_number` | Required | The date to read, usually a cell reference. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| E2 | `=YEAR(B2)` | 2025 | The year of the first invoice |
| E3 | `=YEAR(B3)-YEAR(B2)` | 1 | The calendar year changed, even though the invoices are a week apart |
| E4 | `=SUMPRODUCT((YEAR(B2:B4)=2026)*C2:C4)` | $3,000 | Total of the invoices dated in 2026 |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Invoice | Date | Amount |  | Result |
| 2 | INV-101 | 12/29/2025 | $1,200 |  | 2025 |
| 3 | INV-102 | 1/5/2026 | $860 |  | 1 |
| 4 | INV-103 | 2/14/2026 | $2,140 |  | $3,000 |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| A date like 7/18/1905 instead of 2026 | The cell inherited a date format. YEAR returns a plain number; format the cell as General or Number. |
| #VALUE! | The date is text that Excel can't read. Convert it with DATEVALUE first, or fix the import so the column holds real dates. |
| Ages that are off by one | Subtracting years ignores whether the birthday has passed. Use DATEDIF(start, end, "Y") for completed years. |

## Tips

- Use YEAR in a helper column so SUMIFS can total by year: =SUMIFS(C:C, D:D, 2026).

## Related functions

- [MONTH](https://spreadsheetpractice.com/functions/month): MONTH returns the month of a date as a number from 1 to 12.
- [DAY](https://spreadsheetpractice.com/functions/day): DAY returns the day of the month from a date, as a number from 1 to 31.
- [DATE](https://spreadsheetpractice.com/functions/date): DATE builds a real date from a year, month and day.
- [DATEDIF](https://spreadsheetpractice.com/functions/datedif): DATEDIF counts the complete years, months or days between two dates.

## Questions

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

Use =YEAR(A2). It returns a number like 2026 that you can compare, sum by or use in other formulas.

### How do I calculate age from a birth date?

YEAR(TODAY())-YEAR(A2) overcounts before the birthday. Use =DATEDIF(A2,TODAY(),"Y") for completed years.

## Practice

A graded YEAR exercise ("Year and month") is on [the YEAR page](https://spreadsheetpractice.com/functions/year). It is checked instantly, then re-checked on changed data.

Lessons that use YEAR:

- [Lesson 23: DATE, YEAR, MONTH & TEXT](https://spreadsheetpractice.com/learn/date-year-month-text) (Pro)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
