Date & time function

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)
ArgumentWhat it means
serial_numberRequiredA 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

B2fx=YEAR(A2)
AB
1Invoice dateYear
22026-03-152026

Result: 2026

YEAR returns the four-digit year 2026.

2Total sales for 2026

D2fx=SUMPRODUCT((YEAR(A2:A6)=2026)*B2:B6)
ABCD
1DateSales
22025-12-2918006450
32026-01-062400
42026-02-14950
52026-11-303100
62027-01-04700

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

C2fx=YEAR(TODAY())-B2
ABC
1CompanyFoundedYears
2Fabrikam199828

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

B2fx=DATE(YEAR(A2),12,31)
AB
1Contract startYear end
22026-03-152026-12-31

Result: 2026-12-31

YEAR feeds DATE to build 31 December of the same year (cell formatted as yyyy-mm-dd).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 18 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!The argument is text that cannot be read as a date.Convert with DATEVALUE.
Returns 1900The 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.

Recipes that use YEAR