[Table of Contents] [docx version]
SpreadsheetML Reference Material - Table of Contents
YEAR ( date-value )
Description: Computes the numeric Gregorian year for the date and/or time having the given date-value, taking into account the current date base value. That date and/or time shall be expressed either as a serial value, in which case, its fractional part is ignored, or as a string-constant having any valid date and/or time format, in which case, any time information shall be ignored.
Arguments:
Name |
Type |
Description |
date-value |
number, text |
The date and/or time whose year is to be computed. That date and/or time shall be expressed either as a serial value, in which case, its fractional part is ignored, or as a string-constant having any valid date and/or time format, in which case, any time information shall be ignored. |
Return Type and Value: number – The Gregorian year for the date and/or time having the given date-value. For the 1900 date base system, the returned value shall be in the range 1900–9999. For the 1904 date base system, the returned value shall be in the range 1904–9999.
However, if date-value is out of range for the current date base value, #NUM! is returned.
[Example:
YEAR(DATE(2006,1,2)) results in 2006
YEAR(DATE(2006,0,2)) results in 2005
YEAR("2006/1/2 10:45 AM") results in 2006
YEAR(30000) results in 1982 for the 1900 date base system, or 1986 for the 1904 date base system
end example]