YEAR()

Syntax. YEAR(serial_number)

Definition. This function extracts the four-digit year from a date. The YEAR() function returns an integer between 1900 and 9999.

Arguments

  • serial_number (required). The date from which you want to extract the year.

Background. With this function, as well as with the MONTH() and DAY()functions, you can extract components for use in other calculations.

Take care not to enter the dates as text. The values returned by the functions YEAR(), MONTH(), and DAY() correspond to the Gregorian calendar.

See Also

For more information about saving dates in Excel, see the section titled The Excel Date System in Chapter 2.

Example. You might want to use the Excel AutoFilter to sort a set of data by year and need to calculate the year values from the date column by using an auxiliary column. To do this, use the formula

=YEAR(serial_number)

Here are a few more examples:

  • =YEAR(TODAY()) returns 2010 in the year 2010.

  • =YEAR("11/14/1959") returns 1959.

  • =YEAR("01/01/1900") returns 1900.

  • =YEAR("12/31/1899") returns #VALUE!.

  • =YEAR("12/31/9999") returns 9999.

  • =YEAR("01/01/10000") returns #VALUE!.

See Also

DAY(), HOUR(), MINUTE(), MONTH(), NOW(), SECOND(), TODAY(), WEEKDAY()

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.184.102