YEAR function
Returns an integer representing the Gregorian year in datetime or expression formatted according to the short date style set by the system's current Regional Settings.
Syntax
YEAR("datetime"|expression[,lcid]) | |
datetime |
Any string commonly recognized as a date and time or a reference to a cell containing a date and time. |
expression |
Any expression that yields a date and time. |
lcid |
Optional argument. The locale identifier to be used in evaluating a nonlocal datetime. The locale identifier is a number described in the system header files. |
Remarks
The time component in datetime or expression is discarded.
No rounding is done. If datetime is missing or cannot be interpreted as a valid date or time, returns an error.
The YEAR function also accepts a single number value for expression where the integer portion of the result represents the number of days since December 30, 1899.
Example 1
YEAR("10/27/1999 3:45:24 PM")
Returns 1999.
Example 2
YEAR(DATEVALUE("Dec. 25, 1998") + 7 ed.)
Returns 1999.
Example 3
YEAR(35580.6337)
Returns 1997.