Sei sulla pagina 1di 2

Examples of advanced filter criteria

Advanced filter criteria can include multiple conditions applied in a single column, multiple criteria applied to multiple columns, and conditions created as the result of a formula. Multiple conditions in a single column If you have two or more conditions for a single column, type the criteria directly below each other in separate rows. For example, the following criteria range displays the rows that contain either "Davolio," "Buchanan," or "Suyama" in the Salesperson column. Sales Person Davolio Buchanan Suyama

One condition in two or more columns To find data that meets one condition in two or more columns, enter all the criteria in the same row of the criteria range. For example, the following criteria range displays all rows that contain "Produce" in the Type column, "Davolio" in the Salesperson column, and sales values greater than $1,000.

Type Produce

Salesperson Davolio

Sales >1000

Note You can also specify multiple conditions for different columns and display only the rows that meet all the conditions by using the AutoFilter command on the Data menu. One condition in one column or another To find data that meets either a condition in one column or a condition in another column, enter the criteria in different rows of the criteria range. For example, the following criteria range displays all rows that contain either "Produce" in the Type column, "Davolio" in the Salesperson column, or sales values greater than $1,000.

Type

Salesperson

Sales

Produce Davolio >1000

One of two sets of conditions for two columns To find rows that meet one of two sets of conditions, where each set includes conditions for more than one column, type the criteria in separate rows. For example, the following criteria range displays the rows that contain both "Davolio" in the Salesperson column and sales values greater than $3,000, and also displays the rows for salesperson Buchanan with sales values greater than $1,500.

Conditions created as the result of a formula You can use a calculated value that is the result of a formula as your criterion. When you use a formula to create a criterion, do not use a column label for a criteria label; either keep the criteria label blank or use a label that is not a column label in the list. For example, the following criteria range displays rows that have a value in column G greater than the average of cells E5: E14; it does not use a criteria label.

Notes

The formula you use for a condition must use a relative reference to refer to the column label (for example, Sales) or the corresponding field in the first record. All other references in the formula must be absolute references, and the formula must evaluate to TRUE or FALSE. In the formula example, "G5" refers to the field (column G) for the first record (row 5) of the list. You can use a column label in the formula instead of a relative cell reference or a range name. When Microsoft Excel displays an error value such as #NAME? or #VALUE! in the cell that contains the criterion, you can ignore this error because it does not affect how the list is filtered.

Potrebbero piacerti anche