Advanced custom date filter in Excel 2007
Question: How do I filter the last xx years or xx months in Excel 2007?
How do I exclude the current month when using the year to date filter in Excel 2007?
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
- Click Advanced

- 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.
filter-a-list-of-dates.xlsx
(Excel 2007 Workbook *.xlsx)
Related posts:
Filter overlapping date ranges in excel 2007
Filter overlapping dates from date ranges in excel
List dates outside specified date ranges in excel
Filter and highlight duplicate column records in excel 2007
Filter unique distinct values from two ranges combined in excel 2007



















The advanced filter works perfectly with the dates intervals >DD/MM/YY and DD/MM/YY; however when you record it under a MACRO it does not work !!!
Can someone help?
The advanced filter works perfectly with the dates intervals >DD/MM/YY and <DD/MM/YY; however when you record it under a MACRO it does not work !!!
Can someone help?
What did you record in your macro?