Description
Use this function to return the "year" component of a date as a 4-digit integer in the range 1900-9999 inclusive. Supported in Chains.
Syntax
YEAR(serial_number)
Inputs
This function has the following arguments:
| Name | Required | Description | Valid input |
|---|---|---|---|
serial_number |
Yes | The date of the year you want to find. | A date entered using the DATE function, a cell reference, a number which is a valid date, or a formula which results in any of these. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. |
Example
Sample data
| A | B | |
|---|---|---|
| 1 | Date | Return Type |
| 2 | 3/21/2022 | 1 |
| 3 | 9/14/2019 | 2 |
| 4 | 3 | |
| 5 | 11/30/2017 | |
| 6 | 3/21/2025 | 14 |
Sample formulas
| Use case | Formula | Explanation and Result |
|---|---|---|
| Extract the year value of a date contained in a cell. | =YEAR(A2) |
This formula works in the following manner:
For this data set, this formula returns 2022. |
| Extract the year value of an integer (serial) date contained in a cell. | =YEAR(A3) |
This formula works in the following manner:
For this data set, this formula returns 2023. |
| Extract the year value of a supplied integer (serial) date. | =YEAR(23981) |
This formula works in the following manner:
This formula returns 1965. |
| Extract the year value of a date contained in a cell offset by a supplied value. | =YEAR(A2)-45 |
This formula works in the following manner:
For this data set, this formula returns 1978. |
| Extract the year value of a supplied date. | =YEAR("2024/7/4") |
This formula works in the following manner:
For this data set, this formula returns 2024. |
| Return a specified date using the year value in a cell. | =DATE(YEAR(A2),4,15) |
This formula works in the following manner:
For this data set, this formula returns 1/15/2022. |
Notes
- The date must be in a valid date format and enclosed in quotation marks.
- If
YEARis formatted as text and not in quotation marks,YEARwill return the value "1900". - Wildcards don't work with this function.
Related functions
DATE
DATEVALUE
DAY
DAYS
DAYS360
EDATE
EOMONTH
MONTH
NETWORKDAYS
NETWORKDAYS.INTL
WEEKDAY
WORKDAY
WORKDAY.INTL
YEAR
YEARFRAC