Professional Documents
Culture Documents
Excel 2010 Fórmulas - Parte58
Excel 2010 Fórmulas - Parte58
You can put the criteria range anywhere in the worksheet or even in a different worksheet.
However, you should avoid putting the criteria range in rows that are occupied by the worksheet
database or table. Because Excel may hide some of these rows when filtering, you may find that
your criteria range is no longer visible after filtering. Therefore, you should generally place the
criteria range above or below the table.
Figure 9-16 shows a criteria range in A1:B2, above the worksheet database that it uses. Notice
that the criteria range does not include all the field names from the table. You can include only
the field names for fields that you use in the selection criteria.
In this example, the criteria range has only one row of criteria. The fields in each row of the crite-
ria range (except for the Header row) are joined with an AND operator. Therefore, after applying
the advanced filter, the worksheet database shows only the rows in which the Bedrooms field is 3
and the Pool field is TRUE. In other words, it shows only the listings for three-bedroom homes
with a pool.
You may find specifying criteria in the criteria range a bit tricky. I discuss this topic in detail later
in this chapter in the section, “Specifying Advanced Filter Criteria.”
5. To filter the database in place (that is, to hide rows that don’t qualify), select the option
labeled Filter the List, In-Place.
If you select Copy to Another Location, you need to specify a range in the Copy To field.
6. Click OK, and Excel filters the table by the criteria that you specify.
Figure 9-18 shows the worksheet database after applying the advanced filter that displays three-
bedroom homes with a pool.
When you select the Copy to Another Location option, you can specify which columns
to include in the copy. Before displaying the Advanced Filter dialog box, copy the
desired field labels to the first row of the area where you plan to paste the filtered
rows. In the Advanced Filter dialog box, specify a reference to the copied column labels
in the Copy To field. The copied rows then include only the columns for which you cop-
ied the labels.
The use of a separate criteria range for advanced filtering originated with the original
version of Lotus 1-2-3, more than 20 years ago. Excel adapted this method, and it has
never been changed, despite the fact that specifying advanced filtering criteria remains
one of the most confusing aspects of Excel. Fortunately, however, Excel’s standard fil-
tering is sufficient for most needs.
You also can use standard filtering to perform this type of filtering.
To select only the records that contain a specific value in a specific field, enter the field name in
the first row of the criteria range and the value to match in the second row. Figure 9-19, for
example, shows the criteria range (A1:A2) that selects records containing the value 4 in the
Bedrooms field.
Figure 9-19: The criteria range (A1:A2) selects records that describe homes with four bedrooms.
Note that the criteria range does not need to include all the fields from the database. If you work
with different sets of criteria, you may find it more convenient to list all the field names in the
first row of your criteria range.
To select the records that describe homes that have at least four bedrooms, type Bedrooms in
cell A1 and then type >=4 in cell A2 of the criterion range.
Table 9-2 lists the comparison operators that you can use with text or value criteria. If you don’t
use a comparison operator, Excel assumes the equal sign operator (=).
The text comparisons are not case sensitive. For example, se* matches Seligman, seller,
and SEC.
h A list price less than $250,000, and square footage of at least 2,000
h A single-family home with a pool
h At least four bedrooms, at least three bathrooms, and square footage less than 3,000