YEAR function

YEAR extracts the four-digit year component from a date serial number, returning an integer representing the calendar year, such as 2024 or 2025.

=YEAR(serial_number)

Generate a YEAR formula

Describe what you need. The generator will reach for YEAR where YEAR is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How YEAR reads its arguments
serial_numberrequiredYEAR
ArgumentRequiredDescription
serial_numberRequiredA date value (as a date serial number, date object, or cell reference containing a date). For text dates, wrap with DATEVALUE() first.

Returns

Returns an integer representing the calendar year as a 4-digit number.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Extract the year a task started

TaskStart Date
Q1 Planning2024-01-15
=YEAR(C2)

Result: 2024

YEAR returns the year component of the date in C2 (2024-01-15) as a 4-digit integer. This isolates just the year, ignoring the month and day.

2. Identify projects spanning multiple calendar years

TaskStart DateDue Date
Mobile App2024-11-202025-01-31
=IF(YEAR(C5)<>YEAR(D5),"Spans years","Same year")

Result: Spans years

YEAR extracts 2024 from the start date and 2025 from the due date. Since they differ, the project crosses a year boundary. This pattern is useful for identifying multi-year initiatives.

3. Categorize tasks by year for reporting

TaskStart Date
Audit Report2025-01-05
=IF(YEAR(C4)=2025,"2025 tasks","Prior years")

Result: 2025 tasks

YEAR extracts 2025 from the date in C4, which matches the comparison year, so the formula returns "2025 tasks". Use this pattern to filter or group tasks by fiscal or calendar year.

Common errors

Which YEAR error are you seeing?
YEAR returned an error#VALUE!
If you have text that represents a date, convert it first with DATEVALUE(), e.g., =YEAR(DATEVALUE("2024-01-15")).
#NUM!
Verify your input is an actual date serial or date value within the range of Jan 1, 1900 to Dec 31, 9999.
#REF!
Update the formula to reference an existing cell, or restore the deleted cell and recalculate.
ErrorWhy it happensHow to fix it
#VALUE!Passing text that is not recognized as a valid date format (e.g., "xyz" or "not-a-date").If you have text that represents a date, convert it first with DATEVALUE(), e.g., =YEAR(DATEVALUE("2024-01-15")).
#NUM!Passing a numeric serial number outside the valid date range (typically less than 0 or greater than ~2,958,465).Verify your input is an actual date serial or date value within the range of Jan 1, 1900 to Dec 31, 9999.
#REF!Referencing a cell that has been deleted; if YEAR was pointing to that cell, the reference becomes invalid.Update the formula to reference an existing cell, or restore the deleted cell and recalculate.

Tips and when to use something else

  • Combine YEAR with TODAY() to extract the current year: =YEAR(TODAY()) returns 2025 (or whatever the current year is).
  • YEAR returns a number, not text, so it works seamlessly in math and comparisons. To display it formatted with text, use TEXT(): =TEXT(YEAR(A1),"0000").
  • For complex date logic spanning years, consider DATEDIF() instead, which can calculate the exact number of years between two dates, accounting for leap years.
  • If you need to extract month, day, hour, or other components, reach for MONTH(), DAY(), HOUR(), or DATE() functions depending on your need.

Frequently asked questions

How do I get just the year from a date in a spreadsheet?
Use the YEAR function with the date serial number or cell reference: =YEAR(A1) extracts the year from the date in A1. It returns a 4-digit integer like 2024.
Can YEAR work with text dates?
Not directly. YEAR requires a date serial number or recognized date value. If your date is stored as text (e.g., "2024-01-15"), wrap it with DATEVALUE first: =YEAR(DATEVALUE("2024-01-15")).
What is the difference between YEAR and using MID to extract year from a text date?
YEAR is safer and more reliable for actual dates because it works with date serials and handles different date formats automatically. MID() is a workaround only for text dates stored in a predictable format like "YYYY-MM-DD".
How do I get the current year?
Combine YEAR with TODAY(): =YEAR(TODAY()) returns the current calendar year as a 4-digit number. Update this formula daily or on file open to always reflect the present year.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17