How do I filter the last xx years or xx months in Excel?
How do I exclude the current month when using the year to date filter in Excel?
Answer: Use advanced filter with criteria ranges. I have calculated the exact dates needed to create the criteria ranges.
I will go through the exact steps on how to accomplish the date filter.
The picture below shows the calculation of the dates, the criteria ranges and the list to filter.
How to create a criteria range
- Copy the header of the list to a new location, see cell A16:C16 in the above picture.
- Type the criteria, see A17:B17 in the above picture.
- Formula in A17:
="<=2009-07-31" + ENTER
Formula in B17:
=">=2009-01-01" + ENTER
How to filter a list using a criteria range
- Click "Data" in the ribbon
Select List range: A27:C64
- Select the criteria range A16:C17
- Click OK!
The new filtered list.
Repeat the above steps to filter the last xx years or xx months using the criteria ranges.
Download excel example file.
(Excel 2007 Workbook *.xlsx)