Dates function
Excel YEAR function
YEAR returns the four-digit year from a date. Use it to group orders by year, filter a report to one year, or build a new date with DATE.
=YEAR(date)Arguments
date- The date to read, usually a cell that holds a date.
YEAR examples
Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | |
|---|---|---|---|
| 1 | Employee | Department | Hire date |
| 2 | Priya Nair | Finance | 2019-04-08 |
| 3 | Tom Becker | Sales | 2023-09-18 |
| 4 | Lena Ortiz | Support | 2025-01-06 |
| 5 | Sam Okafor | Sales | 2021-06-14 |
Result: 2019
Returns 2019, the year Priya was hired.
Result: today’s date-based value (it changes every day)
The current year, handy for a report header.
Result: today’s date-based value (it changes every day)
A rough count of calendar years since Sam joined.
Result: New hire
Labels anyone hired in 2025.
How to use YEAR
- Click the cell for the result.
- Type =YEAR(
- Click the cell with the date.
- Close the bracket and press Enter.
Common YEAR mistakes
The result shows as a date in 1905
The cell kept a date format. Change it to General so 2019 shows as a number.
Subtracting years to get an exact age
YEAR minus YEAR ignores the month and day. Use DATEDIF with "Y" for completed years.
The date is really text
Dates pasted from other systems can be text, which gives #VALUE!. Convert them to real dates first.
YEAR FAQ
How do I extract 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 count dates in a specific year in Excel?
Use COUNTIFS with a start and end date, like =COUNTIFS(C2:C9,">="&DATE(2025,1,1),C2:C9,"<"&DATE(2026,1,1)).
Why does YEAR return 1900?
The cell is empty or holds 0, which Excel treats as the start of its calendar. Check that the date cell has a value.
Practice YEAR in these lessons
Guides that use YEAR
- How to calculate age in Excel from date of birth
- How to add months to a date in Excel
- How to calculate months between two dates in Excel
Related functions
Updated