When working with Excel, there may be instances where you’ll need to extract the year from a date. Maybe you’re sorting through a database, analyzing a set of financial data, or planning a series of events, and you need to sort or categorize the data by year. Fortunately, Excel has a built-in function called YEAR that can help you accomplish this task quickly and easily. Let’s see how you can use it.
Using the YEAR Function in Excel
The YEAR function in Excel is a Date/Time function that’s used to return the year of a given date as a four-digit number. The syntax of the YEAR function is pretty straightforward:
YEAR(serial_number)
Here, the serial_number argument is the date that you want to extract the year from. This can be a reference to a cell that contains the date, or a date returned from another Excel function.
How to Extract Year from a Date
Let’s say that you have a date in cell A2, and you want to extract the year from this date. Here’s how you can do it:
=YEAR(A2)
After entering this formula in a cell, it will return the year of the date found in cell A2 as a four-digit number.
Formatting the Extracted Year
By default, Excel might format the extracted year as a date. If this happens, you can change the cell’s format to a number. Here’s how:
- Right-click the cell with the year
- Click on Format Cells
- Choose Number from the category list
- Click OK
Conclusion
As you can see, extracting the year from a date in Excel is simple and straightforward when using the YEAR function. This function can help you analyze and categorize your data more efficiently. And remember, if Excel formats the year as a date, you can easily change it back to a number format.