Excel YEAR Function

Basic Description

The Excel Year function returns an integer representing the year of a supplied date.

The syntax of the function is :

YEAR( serial_number )

where the serial_number argument is the date that you want to return the year from. This can be supplied to the Year function as either:

or

Warning: If you attempt to input the date argument as text, there is a chance that Excel may misinterpret this, depending on the date system, or date interpretation settings on your computer.


Year Function Examples

The following example shows the Year function used to extract the year from 3 different dates.

 Formulas:
  A B
1 Date Year
2 29-May-2012 =YEAR( A2 )
3 05/03/1984 =YEAR( A3 )
4   =YEAR( DATE(2013, 1, 1) )
 Results:
  A B
1 Date Year
2 29-May-2012 2012
3 05/03/1984 1984
4   2013

Note that, in the above examples, as recommended by Microsoft, the serial_number argument is always supplied as either a reference to a cell containing a date, or as a value returned from another function.


Further information and examples of the Excel Year function can be found on the Microsoft Office website.


Year Function Common Problem

Common Problem:

The result of your Year function looks like a date (eg. "01/01/1900"), instead of returning an integer.

Solution:

This problem arises because the new cell or column is formatted as a 'date'. In this case, it is only the formatting of the cell that is wrong, NOT the value returned by the function.

To correct this,

  • Highlight the cell(s) containing the result
  • Right click with the mouse
  • Select the Format Cells ... option and ensure the Number tab is selected
  • Under the Category heading, select the option General and click OK

- Read more about Excel Formatting here

Return to the Excel Date and Time Functions Page

Return to the List of All Built-In Excel Functions

Valid XHTML 1.0 Transitional Valid CSS!
Disclaimer   Privacy Policy
Copyright © 2008-2015 ExcelFunctions.net