ID EN
#Date and time

YEAR

Excel Functions

Get the year from a date

Syntax

EXCEL
=YEAR(date)

Arguments

Parameter Description
date A valid Excel date.

Return Value

Year as 4-digit number

Details

The YEAR function returns the year of a date as a 4-digit number. YEAR takes just one argument, date, which must be a valid date. Date can be a cell containing a date, a date string, or a formula that returns a date. Internally, Excel converts dates to serial numbers following its own date system. For example, given the date "23-Aug-2012", YEAR will return 2021: The YEAR function requires just one argument, which must be a valid date or a value that Excel can convert into a valid date. With the date January 20, 2026, in cell A1, the following formula will return 2026: Note that you can use YEAR to extract the year from a date entered as text: However, using text for dates can cause unpredictable results on computers using different regional date settings. In general, it's better to supply

Examples

Example 1

The YEAR function returns the year of a date as a 4-digit number. YEAR takes just one argument, date, which must be a valid date. Date can be a cell c

EXCEL
=YEAR("23-Aug-2012") // returns 2012
Basic examples

The YEAR function requires just one argument, which must be a valid date or a value that Excel can convert into a valid date. With the date January 20

EXCEL
=YEAR(A1) // returns 2026
Basic examples

Note that you can use YEAR to extract the year from a date entered as text:

EXCEL
=YEAR("1/20/2026") // returns 2026
Basic examples

You can easily combine the YEAR function with other Excel functions. For example, to get the current year, you can use YEAR with the TODAY function li

EXCEL
=YEAR(TODAY()) // returns current year
Basic examples

Using the DATE function, you can extract a year from cell A1 and use it to create the date January 1 in the same year, like this:

EXCEL
=DATE(YEAR(A1),1,1) // first day of same year
Get year from date

Use the DATE function to extract just the year from a date. In the worksheet below, the formula in D5 is:

EXCEL
=YEAR(B5)

See Also

MONTH DAY DATE EDATE EOMONTH