How to Extract The Year from a Date in Excel Using the Year Formula

August 23, 2022

Hey Data friends! Today we will learn how to extract the year from a date field using the YEAR formula. The formula is very straightforward to use, but that means it’s not as flexible as other formulas that can extract the year from a date. If you’d like to learn using a more flexible formula, then head over to the tutorial on the Text formula for Year extraction.

Let’s get started!

The formula to extract the year from a date in Excel is the following:

=Year( DateField )

Where I have DateField, you’d set the cell of the date you need to pull the year from. Let’s walk through an example so we can see the formula in action.

The sample data we will be working with is below:

This is the sample data set we will use to extract the Year from a Date field
Sample data set

This is the same data from our Date Difference tutorial. In that tutorial we calculated the date difference between the Course Start Date and the Course End Date. Today, we will use this data to extract the year from the Course Start Date field.

I added a column where we will type our YEAR formula.

This is the sample data set we will use to extract the Year from a Date field
Prepping our sample data table

Using our year extract formula, we can type out the syntax as follows:

Executing the Year formula in Excel
Executing the Year formula in Excel

What we’re telling Excel with this formula is that we want it to look at the Course Start Date Field (cell C5) and we want it to extract the year. Our output looks like this:

Successfully executed Year formula in Excel
Successfully executed Year formula in Excel

We can run this formula all the way down the table to see it in action. I changed some of the years around (the cells in pink) from the original sample table, since all years were originally 2022 and that doesn’t make for a fun example of the TEXT formula at work. The output looks like the below:

An example with different years; using Excel's year formula
An example with different years

That’s all there is to it, we’ve successfully extracted the year from a date field!

As always, if you have any questions or need anything clarified you can reach me through my DMs on Twitter @Cest_Nick; otherwise, I’ll catch you on the next post!

-Nick

Book a call to explore the different avenues the Analytic Iron team can help You extract insights from Your Data.
BOOK a Discovery cALL