Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Filtering to a Date Range in the Past.

Filtering to a Date Range in the Past

by Allen Wyatt
(last updated October 3, 2019)

1

Bill has a data table with fifty columns and many, many rows. One of the columns contain a record date, with dates that range over the past three years. Bill asked if there was a way to create a filter criteria to display only those records with dates between 91 and 98 days ago.

One solution is to add a new column to your data table that indicates if the record date is in the desired timeframe. Assuming the record date is in column A, the following would work:

=AND(TODAY()-A2>=91,TODAY()-A2<=98)

The result is either a True or False value, depending on the record date. You could then set up the filtering based on the value of the new column. All you need to do is set up the filter so that only those records with a True in the column (those between 91 and 98 days old) would be displayed.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10997) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Filtering to a Date Range in the Past.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Editing Wrap Points

If you have a graphic that has text wrapping around it, you might want a way to modify the wrapping path used by Word. ...

Discover More

Creating a Document Based on a Template

Double-click a Word template file in Windows, and Word should create a brand new document based on that template. If this ...

Discover More

Missing Left Border

Ever wonder why a border around a graphic doesn't print the way it looks on the screen? There are several ways to add and ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Performing Calculations while Filtering

The advanced filtering capabilities of Excel allow you to easily perform comparisons and calculations while doing the ...

Discover More

Removing Duplicates Based on a Partial Match

Some types of data may have certain fields that contain partially identical information. In such cases you may want to ...

Discover More

Skipping Rows when Filling

Using the fill handle is a great way to quickly fill a range of cells with values. Sometimes, however, the way to fill ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 + 3?

2019-10-03 16:29:28

Phil W

This works great, but I would go one step further to make the formulas more flexible. I would enter the 91 and 98 values into unused cells somewhere on the sheet, preferably not within the data rows. It can be unused cells in the header row, or insert a new row above the table, somewhere where they won't get filtered out in the data list.

For example, enter 91 in cell E1 and enter 98 cell G1.
Next, change the formula in Allen's tip to this:

=AND(TODAY()-A2>=$E$1,TODAY()-A2<=$G$1)

Copy and paste the formula down the new column as far as there are entries in the table.

Once the formulas are set up this way, you can simply change the Newest and Oldest values in cells E1 and G1 to change the date range without editing formulas. The only caveat is that if your list is filtered when you change the Newest and Oldest values, you will have to re-filter the list to refresh the filter with new values.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.