Excel AutoFilter is a simple Excel feature for filtering lists. As a consultant or analyst looking through data for answers you are going to need how to filter.
The Excel advanced filter has far more powerful filtering and extracting capability you will want to use with To Do Lists, Contact Lists, Project Task Lists, Inventory Lists, and more.
These tips begin with the simple AutoFilter in Excel and go on to show you the secrets of the Excel advanced filter. With the advanced filter in Excel you can filter and extract data using complex AND and OR criteria impossible with AutoFilter.
Are you an Excel power-user? Jump to the advanced filter tips starting with Tip 11.
Do you know someone who works with Contact Lists, Inventory Lists, To Do or Project Task Lists? Forward this article to them and earn Excel karma points.
“In the beginner’s mind there are many possibilities, but in the experts there are few.”Shunryu Suzuki (1905-1971)
The Excel AutoFilter displays down arrows to the right of each header label in a list or Excel Table. Clicking one or more of the filter arrows displays a dialog box you can use to filter your list or Table.
Excel Tables immediately display AutoFilter arrows when they are created. You can turn the AutoFilter arrows off in an Excel Table when you need to.
To apply an Excel AutoFilter to your list,
1. If the list is surrounded by blank cells, select a cell in the list. If the list has filled cells touching the list border, then select the list headers and all data cells.
2. On the Data tab, in the Sort & Filter group, click Filter. The AutoFilter arrows will display.
AutoFilter arrows that have a dot next to them indicate a filter criterion has been applied.
Click here to learn more about the basics of Excel lists and Excel Tables.
To apply one or more AutoFilters to an Excel list or Excel Table column,
1. Click the AutoFilter arrow on the header label you want to filter.
2. The AutoFilter menu gives you options to sort or filter by the contents of that column.
3. AutoFilter menu options change depending upon the column’s contents. In this figure, the Region column contains text data, so only Text Filters are available in a side menu. The types of filters available are Number, Text, Date, and Color. The conditional criteria, such as Equals, Contains, etc., change to match the type of filter.
4. You can apply AutoFilters to multiple columns. The AutoFilters in all columns must be TRUE for data to display. (If you need to work around this limit, use the Excel advanced filter described starting at tip 11.)
Filters that contain criteria show a dot next to the filter arrow in the header label.
To remove a filter from a column, click the AutoFilter arrow, then select Clear Filter.
To search for an exact match to data, use the checkboxes listed at the bottom of the AutoFilter menu. This list of checkboxes shows data unique to the column. Select checkboxes of the data you want to be displayed and clear checkboxes of data you want filtered.
Top 10, Bottom 20, Top 25%, are all the type of lists items that often go in reports. Although Excel calls this the Top 10 AutoFilter, it does much more.
To display the top n or bottom n items or percent,
1. Click the AutoFilter arrow in the header of a numeric column.
2. Select Number Filters, Top 10.
3. In the Top 10 AutoFilter dialog box select whether you want to display the Top or Bottom of any number of Items or Percent.
4. Enter the number or percent to display. Select whether you want Items or Percent, then click Ok.
This only works on columns with numeric data. If you don’t see this AutoFilter, check to make sure the column contains only numbers.
Excel AutoFilter can filter with either the AND or the OR condition. Selecting many of the AutoFilter menu items will display the Custom AutoFilter dialog box with the appropriate conditions preselected to match your menu selection.
If you want to immediately display the Custom AutoFilter dialog box, select Custom Filter after selecting the AutoFilter arrow and the Filter menu item.
Custom AutoFilter enables you to choose,
When you are analyzing open text responses to surveys, filtering inventory lists with scrambled names, or searching contact lists for near matches, you can use the Contains criteria in Excel AutoFilter to help.
To use the Excel AutoFilter to find and filter text within longer strings of text,
1. Click the AutoFilter arrow in the header of a text column.
2. Select Text Filters, then Contains. This displays the Custom AutoFilter dialog.
3. If you have one criterion, click Ok to filter the list.
4. If you want to include “cut” but want to exclude special cases that contain other text you must enter another criteria on the second line. For example, to find “cut” but exclude instances that also contain “Lite”, click And, and select Does Not Contain, and type “Lite.”
5. Choose Ok.
Number or date ranges frequently used in Excel AutoFilter to limit reports.
To use Excel AutoFilter for a numeric or date range,
1. Click the Excel AutoFilter arrow in a number column. Make sure the column contains only numbers. If the column contains text, other than the header, the filter will not work.
2. For a numeric column, click Number Filters, Between to display a Custom AutoFilter dialog preconfigured for numeric ranges.
3. Select from the left drop-downs how you want the range to start and end.
4. In the right drop-downs either type the numeric limits or select them from the drop-downs.
Date ranges are one of the most frequent uses for filtering lists.
1. Click the Excel AutoFilter arrow in a date column. Make sure the column contains only dates. If the column contains text, other than the header, the filter will not work.
2. Click Date Filters.
3. You can select predefined date ranges from the sub-menu, for example, Last Week, This Quarter, Last Month, etc. or select Custom Filter.
4. If you need a custom range, select Custom Filter to display the Custom AutoFilter dialog box. Select start and end dates for the range by clicking the calendar icons at the right and selecting start and end dates.
5. Click Ok.
Excel AutoFilter works with wildcards. You can use wildcards as substitutes for an individual character or string of characters in text filters.
Use an * (asterisk) as a wildcard for multiple text characters. For example, *cut, will filter for Lite Cut and Heavy Cut.
Use a ? (question mark) as a wildcard for any single text character. For example, st??r, will filter for steer and stair.
When you need a quick, easy-to-use filter, but one that filters using only large categories, use a Slicer. Slicers are boxes that display on your worksheet. They contain buttons that display a list of unique contents for the column you want as a filter. Click one of the buttons and the list or Excel Table is filtered.
To select multiple Slicers, hold the Ctrl key as you click a slicer.
Click here to learn how to add a Slicer.
The Excel AutoFilter is easy to display and use, but it is cannot create some of the more complex filters. With the Excel Advanced Filter you can create very complex filters as well as extract filtered data into a new list.
The advanced filter in Excel uses three ranges, the list or Excel Table, the Criteria range containing logical formulas that define the filter, and an optional Extract range. This figure shows the list or Table on the left, a Criteria range in green, and the optional Extract range on the right.
Extracted data does not have to be in the same column order as the original list or Excel Table so it is an excellent method of creating lists for reports.
To set up an advanced filter in Excel,
1. Create a normal list or Excel Table.
2. Create a Criteria range that includes header labels at the top that are exactly the same as the list or Table.
To apply the advanced filter in Excel,
1. Select a cell in the list or Excel Table.
2. On the Data tab, in the Sort & Filter group, click Advanced to display the Advanced Filter dialog box.
3. Select Filter the list, in-place.
4. Select the List or Excel Table range. If you have assigned the list or Excel Table a range name, enter the range name.
5. Select the Criteria range including the header labels and all rows containing criteria.
6. Click Ok to filter the data in place.
The cell references or range names, for the list or Table and Criteria are remembered and are automatically entered the next time you display the Advanced Filter dialog box. If you are using multiple lists, Criteria, or Extract ranges be sure to change the ranges to match the worksheet you are working on.
To remove a filter, clear the cells under the header labels in the Criteria range and rerun the Advanced Filter.
Use the AND criteria when ALL criteria in the AND condition must be TRUE. The AND condition is most often used with date or number ranges.
An advanced Excel filter that uses AND conditions may have one row, but will use multiple header labels for the AND criteria, for example,
Units>=200 AND Units<250
The Units header label is used once for each Unit criteria. The header label must be spelled exactly, so it is best to copy it.
In this figure, the filter has already been applied and then the Advanced Filter dialog box redisplayed.
Excel filter formulas in the Criteria range must be entered in quotes. The formulas in this example are,
The Excel filter formula in quotes must evaluate to TRUE for a row to be selected by the filter.
Use the OR criteria where one criterion OR the other must be TRUE. OR criteria are most often used when filtering for one text item OR another.
An advanced Excel filter that uses OR conditions will have more than one row, with each row being one of the items being filtered for, for example,
Region=North OR Region=South
The Region header label is used once in the Criteria range for an OR. The header label must be spelled exactly as it is in the List or Table, so it is best to copy it.
In this figure, the filter has already been applied and then the Advanced Filter dialog box redisplayed.
Excel filter formulas in the Criteria range must be entered in quotes. But, exact text used as criteria can be entered directly, for example,
An Excel advanced filter can create very complex criteria for filtering or extracting data. The AND and OR criteria can be independent or dependent upon each other.
Advanced filters in Excel often use combinations of AND and OR criteria that involve many rows. For simplicity, this example only uses two rows in the Criteria range, but the advantage of an advanced filter in Excel is that it can have many rows and criteria.
An advanced Excel filter using OR criteria will have more than one row.
In this figure, the Region header label is used with the text East and West under it to create an AND criteria. The Units header label in the Criteria range is repeated twice to create an AND criteria for a numeric range.
The example shows the list after filtering with the Advanced Filter dialog box redisplayed. The two Criteria rows translate in English to,
Rows with dates on or after April 1, 2017 AND containing East regionsandRows containing West regions AND Units greater than or equal to 200 and less than 250.
The Excel filter formulas for this are,
Date is >=04/01/17
Region is East or West
Extracting a filtered list is very useful for creating a second list for reporting on data meeting your criteria. It can be used with To Do lists, Contact lists or Tables, inventory lists, or lists of any type. For example, you may need a list of all employees who need recertification, a list of all vehicles having more than 100,000 miles, all sales reps who have sold more than quota in the Western region, and more.
If you can filter the list, then you can extract it to create a new list. Here’s how,
1. Create your list or Excel Table.
2. Create your Criteria for an advanced filter.
3. Test the criteria using advanced find to make sure it displays only the rows you want to be extracted.
4. Enter header labels in the order needed for the report. You can use only header labels you need in any order you want. You can create the report on another worksheet.
Warning! Create your extract area and enter your report headers in an area that will not have rows hidden if the list or Table is filtered.
5. Select a cell in the list or Excel Table, then on the Data tab, in the Sort & Filter group, click Advanced Filter.
6. Select Copy to Another Location.
7. Enter the list or Table range and the Criteria range.
8. Enter the header labels range in the Copy To area.
9. Click Ok.
You can put the header labels in any order in the Extract range. This gives you the ability to arrange your report data as you need.
Also, you can leave out header labels for data you do not need in the report. If you do leave out header labels in an extract it may create duplicate rows. To prevent duplicates, select the Unique records only checkbox in the Advanced Filter dialog box.
If you have a list from which you want to remove duplicates, click inside the list, then on the Data tab, in the Data Tools group, click Remove Duplicates. This permanently removes duplicate rows.
If you want to use Excel to create a second list with duplicates removed, then use the Advanced Filter dialog box to create an extract, as described in tip 16, and select the Unique records only check box.
Here are a few troubleshooting tips to help when your Excel filter is not working.