Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. 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, 2013, 2016, 2019, and Excel in Office 365. 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

Controlling Repagination in Macros

Want to turn off document repagination while your macro does its work? Here are two approaches you can use.

Discover More

Finding Cross-References to Specific Bookmarks

Word allows you to create a cross-reference to several different types of content in your documents. For instance, you ...

Discover More

Making AutoComplete Work for an Entire Column

AutoComplete is a great feature for quickly adding data to a worksheet. If you are confused by why some things are picked ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Copying the Results of Filtering

Filtering is a great asset when you need to get a handle on a subset of your data. Excel even makes it easy to copy the ...

Discover More

Filtering Columns

The filtering tools provided in Excel make it easy to filter a data list so that only certain rows are displayed. What if ...

Discover More

Column Formatting Based On a Filter

When working with filtered data, you may want to specially format a column that has a filter applied to it. Here are a ...

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 three less than 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.