Excel - YEAR Function



YEAR Function

The Excel YEAR function generates an integer value of the four digits representing the year corresponding to a given date. The range of years being retrieved is between 1900 and 9999. The YEAR function was launched in Excel 2007 and is categorized under the Date & Time functions. When you evaluate the YEAR function, the Microsoft Excel tool extracts the year from the date format dd/mm/yyyy or the date serial number.

The Excel current YEAR formula is =YEAR(today()), which returns the current year 2024.

Compatibility

This advanced Excel function is compatible with the following versions of MS Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016
  • Excel 2013
  • Excel 2010
  • Excel 2007

Syntax

The syntax of the YEAR function is as follows −

=YEAR(serial_number)

Arguments

You can use the following arguments with the YEAR function −

Argument Description Required/ Optional
Serial_number It specifies the cell reference points to a date, date values retrieved after evaluation of other formulas, and cell reference points to a specific date. Required

Points to Remember

  • The Microsoft Excel uses the date serial numbers to save the dates for future calculations. By default, serial number 1 is assigned to January 1, 1900, and serial number 39448 is assigned to January 1, 2008, because 39,448 days are there after January 1, 1900.
  • The values returned by the YEAR functions are Gregorian values no matter how the supplied date value is displayed

YEAR Function Not Working in Excel?

Several factors are listed below that may hinder getting the correct Year when using the YEAR function in Excel.

1. If you use an older version before Excel 2007, then the #NAME! Error may occur.

2. If the invalid dates before 1900 are specified in a cell, then the YEAR function will not work.

3. If the text string is specified in the Serial_Number argument, then the YEAR function will retrieve the #VALUE error.

4. Make sure to use the Date format to see the dates in readable form.

5. If the negative value is specified with the serial numbers, then this function will return the #NUM! error.

Example of YEAR Function in Excel

Practice the following example to learn the use of the YEAR function in Excel.

What does the YEAR Function do in Excel?

In this example, we will demonstrate the evaluation of the YEAR function in the specific cell range C2:C4.

Solution

Step 1 − First, assume the sample dataset comprises the Date and Year columns where the date serial number and valid dates are specified in the Date column.

What does YEAR Function do in Excel1

Step 2 − After that, double-click on the C2 cell and enter the formula =YEAR(B2).

What does YEAR Function do in Excel2

Therefore, the YEAR function retrieves the 2016 from the supplied serial number.

What does YEAR Function do in Excel3

Step 3 − Furthermore, select cell C2, drag the + sign(fill handle), and drop it into the C5 cell to evaluate the year function in the cell range C3:C5.

What does YEAR Function do in Excel4

Therefore, we have successfully applied the YEAR formula in Excel from the date in the C3 and C4 cells, and the Excel YEAR function returns 1905 in the C6 cell.

Download Practice Sheet

You can download and use the sample data sheet to practice the YEAR function.

Advertisements