How to Use the YEAR Function in Excel
Today, we will delve into the capabilities of a crucial function in Excel and Google Sheets – the YEAR function. This function is primarily used to extract the year from a specified date.
Overview
The YEAR function accepts a date input and returns the year component of that date as a four-digit integer.
Syntax
The syntax for the YEAR function is consistent between Excel and Google Sheets:
=YEAR(serial_number)
- serial_number – The date from which the year is extracted.
Examples
Example 1: Basic Usage
Suppose cell A1 contains the date “1/15/2022”. To derive the year from this date using the YEAR function, the following formula would be implemented:
Date (A1) | Year |
---|---|
1/15/2022 | =YEAR(A1) |
1/15/2022 | 2022 |
Example 2: Using the Function in a Calculation
The YEAR function can also be integrated into calculations. For example, it can be used to compare the year extracted from a date to the current year. In the following scenario, we assess whether the year in cell A2 matches the current year:
Date (A2) | Is Current Year? |
---|---|
6/20/2021 | =YEAR(A2)=YEAR(TODAY()) |
6/20/2021 | FALSE |
Conclusion
The YEAR function proves to be an invaluable asset for extracting and analyzing year data from dates in Excel and Google Sheets. Mastery of this function enables more effective date manipulations and diverse analytical possibilities based on year data.
More information: https://support.microsoft.com/en-us/office/year-function-c64f017a-1354-490d-981f-578e8ec8d3b9