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.
語法
YEAR(serial_number)
Inputs
This function has the following arguments:
名稱 | 必要 | 說明 | Valid input |
---|---|---|---|
serial_number |
是 | 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. |
範例
範例資料
A |
---|
23-Aug-2022 |
45283 |
Sample formulas
公式 | 說明 | 結果 |
---|---|---|
=YEAR(A1) |
Returns the value of the year in the date contained in cell A1. | 2022 |
=YEAR(A2) |
Returns the value of the year in the date contained in cell A2. | 2023 |
=YEAR(23981) |
Returns the year value of the supplied number. | 1965 |
=YEAR(A2)-45 |
Returns the value of the year in the date contained in cell A2 minus 45. | 1978 |
=YEAR("2024/7/4") |
Returns the value of the year in the supplied date. | 2024 |
附註
- The date must be in a valid date format and enclosed in quotation marks.
- If
YEAR
is formatted as text and not in quotation marks,YEAR
will 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