How to Filter Dates by Year in Excel (With Example)

In Excel, you can use the YEAR function to filter data by year. You can use this function to extract the year from a date in a cell. To do this, you first need to enter the date in the cell, then use the YEAR formula to extract the year. Once you have extracted the year, you can then use the Filter feature in Excel to filter the data by the year. This example shows you how to filter dates by year in Excel.


Often you may want to filter dates by year in Excel.

Fortunately this is easy to do using the Filter function.

The following step-by-step example shows how to use this function to filter dates by year in Excel.

Step 1: Create the Data

First, let’s create a dataset that shows the total sales made by some company on various days:

Step 2: Add a Filter

Next, highlight the cells in the range A1:B13 and then click the Data tab along the top ribbon and click the Filter button:

A dropdown filter will automatically be added to the first row of column A and column B.

Step 3: Filter Dates by Year

Next, we’ll filter the data to only show the rows where the year contains 2021.

Click the dropdown arrow next to Date, then uncheck all of the boxes except the one next to 2021 and then click OK:

The data will automatically be filtered to only show the rows where the date is in 2021:

If you’d like to filter for multiple years (such as 2020 and 2021), simply check the boxes next to both 2020 and 2021:

The data will automatically be filtered to only show the rows where the date is in 2020 or 2021:

x