YEAR function
Returns the four-digit year of a date, from 1900 to 9999.
Available in All versions of Excel (Windows and Mac), Excel for Microsoft 365, Excel for the web
In every Excel versionWorks in Google Sheets
Syntax
YEAR(serial_number)| Argument | What it means | |
|---|---|---|
serial_number | Required | A date, a formula returning a date, or a date serial number. |
Returns: A whole number between 1900 and 9999.
How YEAR works
YEAR extracts the year from a date: given 15 March 2026 it returns 2026. It is the go-to function for yearly summaries, for checking which financial year a transaction belongs to, and for simple "how many years since" calculations such as company age or the year a contract started.
The result is a plain number, so you can compare it (YEAR(A2)=2026), do arithmetic with it, or rebuild dates with DATE — for example DATE(YEAR(A2),12,31) is the last day of that year. To count or sum by year, combine YEAR with SUMPRODUCT, or compare dates against the first and last day of the year with SUMIFS, which is faster on big tables.
Examples
1Year of an invoice
| A | B | |
|---|---|---|
| 1 | Invoice date | Year |
| 2 | 2026-03-15 | 2026 |
Result: 2026
YEAR returns the four-digit year 2026.
2Total sales for 2026
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Date | Sales | ||
| 2 | 2025-12-29 | 1800 | 6450 | |
| 3 | 2026-01-06 | 2400 | ||
| 4 | 2026-02-14 | 950 | ||
| 5 | 2026-11-30 | 3100 | ||
| 6 | 2027-01-04 | 700 |
Result: 6450
The YEAR test returns TRUE only for the three 2026 dates; multiplying by the sales keeps 2,400 + 950 + 3,100 = 6450.
3Years since a company was founded
| A | B | C | |
|---|---|---|---|
| 1 | Company | Founded | Years |
| 2 | Fabrikam | 1998 | 28 |
Result: 28
If today is 2 Dec 2026, YEAR(TODAY()) is 2026 and 2026 − 1998 = 28. This counts calendar years, not exact anniversaries — use DATEDIF for those.
4Last day of the year
| A | B | |
|---|---|---|
| 1 | Contract start | Year end |
| 2 | 2026-03-15 | 2026-12-31 |
Result: 2026-12-31
YEAR feeds DATE to build 31 December of the same year (cell formatted as yyyy-mm-dd).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The argument is text that cannot be read as a date. | Convert with DATEVALUE. |
Returns 1900 | The cell is empty or holds a small number, not a real date. | Check the source data. |
Tips
- If YEAR returns something like 1905, the input is probably a plain number (e.g. 2026 typed as a year) rather than a date — 2026 as a date serial is 18 July 1905.
- For financial years that do not start in January, add a month test:
=YEAR(A2)+(MONTH(A2)>=7)for a July start.
Questions
Why does YEAR return 1905 when the cell shows 2026?
The cell holds the number 2026, not a date. As a date serial, 2026 is in 1905. If you already have a year number, you don't need YEAR.
How do I extract the year from a text date?
Convert first: =YEAR(DATEVALUE(A2)), or use LEFT/RIGHT if the text has a fixed layout.
Google Sheets
YEAR also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
YEAR in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | ROK |
| Danish | ÅR |
| Dutch | JAAR |
| Finnish | VUOSI |
| French | ANNEE |
| German | JAHR |
| Hungarian | ÉV |
| Italian | ANNO |
| Norwegian (Bokmål) | ÅR |
| Polish | ROK |
| Portuguese (Brazil) | ANO |
| Portuguese (Portugal) | ANO |
| Russian | ГОД |
| Spanish | AÑO |
| Swedish | ÅR |
| Turkish | YIL |
Recipes that use YEAR
- How to add months to a date in Excel
- How to calculate age in Excel
- How to convert a date to text in Excel
- How to get the first and last day of the month in Excel
- How to get the quarter from a date in Excel
- How to sum values by month in Excel