The YEAR function returns the year of the specified date.
This function can be useful when you need to work with dates and analyze data by year.
Syntax
YEAR(date)
Argument |
Description |
Permitted values |
|---|---|---|
date |
Date from which you need to obtain the year |
Reference to a cell containing a date, a function that returns a date value, a row containing a date in a valid format |
Examples of use
Retrieving the year from a date
If you have a date in cell A1, for example, 03/15/2023, you can obtain the year as follows:
=YEAR(A1)
Result: 2023.
Direct entry of the date into the formula
=YEAR("12/25/2024")
Result: 2024.
Retrieve the year from the current date
=YEAR(TODAY())
This formula will return the current year.
Notes
–Make sure that the date value is in the correct format, otherwise the function will return the #VALUE! error.
–If the argument contains a time, the function will ignore the time part and return only the year.