Search Contextures Sites ![]()
Excel Advanced Filter Introduction
1. Excel Advanced Filter--Introduction
a) Apply an Excel Advanced Filter
b) Filter Unique Records
c) Extract Data to Another Worksheet
d) Setting up the Criteria Range
e) Using Wildcards in Criteria
f) Criteria Examples
2. Advanced Filters -- Complex CriteriaFor Excel 2003 instructions,
see Excel 2003 Advanced Filter Introduction
Apply an Excel Advanced Filter1. Set up the database
Download zipped Excel advanced filter workbook
with sample data and criteria.
2. Set up the Criteria Range (optional)
In the criteria range for an Excel advanced filter, you can set the rules for the data that should remain visible after the filter is applied. You can use one criterion, or several.
- In this example, cells F1:F2 are the criteria range.
- The heading in F1 exactly matches a heading (D1) in the database.
- Cell F2 contains the criterion. The > (greater than) operator is used, with the number 500 (no $ sign is included)..
After the Excel advanced filter is applied, orders with a total greater than $500 will remain visible.
Other operators include:
< less than
<= less than or equal to
>= greater than or equal to
<> not equal to
3. Set up the Extract Range (optional)If you plan to copy the data to another location, you can specify the columns that you want to extract. If you want to extract ALL columns, you can leave the extract range empty for the Excel advanced filter.
4. Apply the Excel Advanced Filter
- Select a cell in the database.
- On the Excel Ribbon's Data tab, click Advanced, to open the Advanced Filter dialog box
- You can choose to filter the list in place, or copy the results to another location.
- Excel should automatically detect the list range. If not, you can select the cells on the worksheet.
- Select the criteria range on the worksheet
- If you are copying to a new location, select a starting cell for the copy
Note: If you copy to another location, all cells below the extract range will be cleared when the Advanced Filter is applied.- Click OK
Filter Unique RecordsYou can use an Excel Advanced Filter to extract a list of unique items in the database. For example, get a list of customers from an order list, or compile a list of products sold. In this example, the unique list is copied to a different location, and the original list in unchanged.
Note: The list must contain a heading, or the first item may be duplicated in the results.
- Select a cell in the database.
- On the Excel Ribbon's Data tab, click Advanced.
- In the Advanced Filter dialog box, choose 'Copy to another location'.
- For the List range, select the column(s) from which you want to extract the unique values.
- Leave the Criteria Range blank.
- Select a starting cell for the Copy to location.
- Add a check mark to the Unique records only box.
- Click OK.
Watch the Video
View the steps described above, in a short video clip. Excel 2007 video
Extract Data to Another WorksheetIf the database is on one sheet, you can extract data to a different sheet, by using an Excel Advanced Filter. In this example, the data is on Sheet1, and will be copied to Sheet2.
- Go to Sheet2
- Select a cell in an unused part of the sheet (cell C4 in this example).
- On the Excel Ribbon's Data tab, click Advanced
- Choose Copy to another location.
- Click in the List Range box
- Select Sheet1, and select the database.
- (optional) Click in the Criteria range box.
- Select the criteria range
- Click in the Copy to box.
- Select the cell on Sheet2 in which you want the results to start, or select the headings that you have typed on Sheet2.
- (optional) Check the box for Unique Values Only
- Click OK
Watch the Video
View the steps described above, in a short Excel video tutorial on Excel advanced filter.
Setting up the Excel Advanced Filter Criteria Range
AND vs OR
If a record meets all criteria on one row in the criteria area, it will pass through the Excel advanced filter. In example 1, at right --
- the customer must be MegaMart
- AND the product must be Cookies
- AND the total must be greater than 500.
1.
![]()
Criteria on different rows are joined with an OR operator. In the second example at right --
- the customer must be MegaMart
- OR the product must be Cookies
- OR the total must be greater than 500.
2.
![]()
By using multiple rows, you can combine the AND and OR operators. In the third example at right --
3.
![]()
Using Wildcards in CriteriaUse wildcard characters to filter for a text string in a cell.
The * wildcard
The asterisk (*) wildcard character represents any number of characters in that position, including zero characters.
In this example, any customer whose name contains "mart" will pass through the Excel advanced filter.
![]()
The ? wildcardThe question mark (?) wildcard character represents one characters in that position.
In this example any 4-letter product that begins with c, and ends with ke, will pass through the Excel advanced filter. Both Coke and Cake are in the filtered results.
![]()
The ~ wildcardThe tilde (~) wildcard character lets you search for characters that are used as wildcards.
In the first example at right, an asterisk is in the criteria cell -- Good*Eats -- so any products that begins with Good and ends with Eats, will pass through the Excel advanced filter.
To find only the product that is named Good*Eats, use a tilde character in front of the asterisk in the critereia cell. -- Good~*Eats.
![]()
![]()
Excel Advanced Filter Criteria ExamplesExtract Items in a Range
To extract a list of items in a range, you can use two columns for one of the fields. In this example, two columns are used for the Date field.
If you enter two criteria on the same row in the criteria range, you create an AND statement. In this example, any records that are extracted must be greater than or equal to the first date AND less than or equal to the second date.
Create Two or More Sets of ConditionsIf you enter criteria on different rows in the criteria range, you create an OR statement.
In this example, extracted records must meet both conditions in row 2 OR both conditions in row 3.
In the results, only the records for MegaMart Cookies, or for MiniMart Milk will be in the filter results.
![]()
Extract Items with Specific TextWhen you use text as criteria with an Excel advanced filter, Excel finds all items that begin with that text.
For example, if you type "Ice" as a criterion, Excel finds "Ice", "Ice Cream" and "Ice Milk"
To extract only the records for Ice, use the following format:
="=Ice"
Download zipped Excel advanced filter workbook
with sample data and criteria.For Excel 2003 instructions,
see Excel 2003 Advanced Filter Introduction
Excel Advanced Filter Tutorials:
Excel Advanced Filters -- Complex Criteria
1. AutoFilter Basics
2. AutoFilter Tips
3. AutoFilter Programming
Contextures Inc., Copyright ©2011
All rights reserved.