What is the YEAR function?
=YEAR(serial_number)YEAR returns only the year of a date as a number: an integer from 1900 to 9999.
Inside Excel a date is a serial number (January 1, 1900 is 1), so it is hard to calculate with the year, month and day directly. Taking them apart with YEAR, MONTH and DAY lets you test conditions or build other dates.
YEAR is usually the first step in yearly reporting: add a Year column to a list of transactions and a PivotTable or SUMIFS can total by year. If your fiscal year starts in April or July, shift the date back a few months with EDATE before taking the year.
Arguments
- serial_number
- The date to take the year from: a cell with a date, the DATE function or the result of another date function.
YEAR examples
Example 1. Take the year from a date
=YEAR(A2)If A2 is 2026-05-04, the result is 2026.
Example 2. With DATE
=DATE(YEAR(A2), MONTH(A2)+1, DAY(A2))Take the parts of A2 and add 1 to the month for the same day next month. If that day does not exist (as with January 31), it rolls into the following month; use EDATE for exactly one month later.
Example 3. Fiscal year starting in April
=YEAR(EDATE(A2, -3))Moving the date back three months puts April through the next March in one year. The result is the year the fiscal year began.
A2 =YEAR(A2) Fiscal year 2026-03-31 2026 2025 2026-04-01 2026 2026 2027-02-28 2027 2026 Example 4. Year and quarter label
=YEAR(A2)&"-Q"&ROUNDUP(MONTH(A2)/3, 0)For 2026-05-04 the result is "2026-Q2".
Example 5. Sales for one year
=SUMIFS(D:D, A:A, ">="&DATE(F2,1,1), A:A, "<"&DATE(F2+1,1,1))Put 2026 in F2 to add the 2026 sales. It filters by a date range instead of converting the column with YEAR.
Common mistakes
Typing a date as text
A date typed as text in quotes, such as "2026-5-4", may be read differently or fail depending on the computer's date settings. Microsoft recommends using the DATE function or a cell with a date.
Seeing the result as a date
The result of YEAR is a plain number, not a date. If the result cell is formatted as a date, 2026 shows up as an odd date; set the format to General or Number.
Passing a year number to YEAR
If A2 already holds 2026, =YEAR(A2) reads it as serial number 2026 and returns 1905.
Year difference as age
=YEAR(TODAY())-YEAR(B2) ignores whether the birthday has passed. Use DATEDIF for full years.
FAQ
- Can YEAR take a text date?
- Text Excel recognizes as a date, such as "2026-05-04", usually works, but it can depend on the computer's settings. A date cell or the DATE function is safer.
- How do I get the day of the week?
- Use WEEKDAY for a number, or TEXT(A2,"ddd") for the name.
- How do I build January 1 of that year?
- =DATE(YEAR(A2), 1, 1). December 31 is =DATE(YEAR(A2), 12, 31).