1. Extract the year a task started
| Task | Start Date |
| Q1 Planning | 2024-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.
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)Describe what you need. The generator will reach for YEAR where YEAR is the right tool, and tell you when it is not.
| Argument | Required | Description |
|---|---|---|
| serial_number | Required | A date value (as a date serial number, date object, or cell reference containing a date). For text dates, wrap with DATEVALUE() first. |
Returns an integer representing the calendar year as a 4-digit number.
Excel: All · Google Sheets: Supported
| Task | Start Date |
| Q1 Planning | 2024-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.
| Task | Start Date | Due Date |
| Mobile App | 2024-11-20 | 2025-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.
| Task | Start Date |
| Audit Report | 2025-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.
| Error | Why it happens | How 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. |
The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.
Open the formula generatorReviewed 2026-09-17