0% found this document useful (0 votes)
56 views43 pages

Excel Filter

The document provides a comprehensive guide on how to filter data in Excel using various methods, including basic filters, number and text filters, date filters, advanced filters, and the use of data forms. It also covers how to remove duplicates, outline data, and utilize the SUBTOTAL function for accurate calculations. Additionally, it introduces the UNIQUE and FILTER functions available in Excel 365/2021 for extracting unique values and records based on specific criteria.

Uploaded by

anuanamika0220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views43 pages

Excel Filter

The document provides a comprehensive guide on how to filter data in Excel using various methods, including basic filters, number and text filters, date filters, advanced filters, and the use of data forms. It also covers how to remove duplicates, outline data, and utilize the SUBTOTAL function for accurate calculations. Additionally, it introduces the UNIQUE and FILTER functions available in Excel 365/2021 for extracting unique values and records based on specific criteria.

Uploaded by

anuanamika0220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 43

Filter

Filter your Excel data if you only want to display records that meet
certain criteria.

1. Click any single cell inside a data set.

2. On the Data tab, in the Sort & Filter group, click Filter.

Arrows in the column headers appear.

3. Click the arrow next to Country.

4. Click on Select All to clear all the check boxes, and click the check box
next to USA.
5. Click OK.

Result. Excel only displays the sales in the USA.

6. Click the arrow next to Quarter.

7. Click on Select All to clear all the check boxes, and click the check box
next to Qtr 4.
8. Click OK.

Result. Excel only displays the sales in the USA in Qtr 4.

9. To remove the filter, on the Data tab, in the Sort & Filter group, click
Clear. To remove the filter and the arrows, click Filter.

There's a quicker way to filter Excel data.

10. Select a cell.


11. Right click, and then click Filter, Filter by Selected Cell's Value.

Result. Excel only displays the sales in the USA.


Note: simply select another cell in another column to further filter this
data set.

Number and Text Filters


Number Filter | Text Filter

This example teaches you how to apply a number filter and a text
filter to only display records that meet certain criteria.

1. Click any single cell inside a data set.

2. On the Data tab, in the Sort & Filter group, click Filter.

Arrows in the column headers appear.


Number Filter
To apply a number filter, execute the following steps.

3. Click the arrow next to Sales.

4. Click Number Filters (this option is available because the Sales column
contains numeric data) and select Greater Than from the list.
5. Enter 10,000 and click OK.

Result. Excel only displays the records where Sales is greater than
$10,000.

Note: you can also display records equal to a value, less than a value,
between two values, the top x records, records that are above average,
etc. The sky is the limit!

Text Filter
To apply a text filter, execute the following steps.

3. Click the arrow next to Last Name.

4. Click Text Filters (this option is available because the Last Name column
contains text data) and select Equals from the list.
5. Enter ?m* and click OK.

Note: A question mark (?) matches exactly one character. An asterisk (*)
matches a series of zero or more characters.

Result. Excel only displays the records where the second character of Last
Name equals m.
Date Filters
This page teaches you how to apply a date filter to only display records
that meet certain criteria.

1. Click any single cell inside a data set.

2. On the Data tab, in the Sort & Filter group, click Filter.

Arrows in the column headers appear.

3. Click the arrow next to Date.

4. Click on Select All to clear all the check boxes, click the + sign next to
2015, and click the check box next to January.
5. Click OK.

Result. Excel only displays the sales in 2015, in January.

6. Click the arrow next to Date.

7. Click on Select All to select all the check boxes.

8. Click Date Filters (this option is available because the Date column
contains dates) and select Last Month from the list.
Result. Excel only displays the sales of last month.

Note: this date filter and many other date filters depend on today's date.

Advanced Filter
And Criteria | Or Criteria | Formula as Criteria
This example teaches you how to apply an advanced filter in Excel to
only display records that meet complex criteria.

When you use the Advanced Filter, you need to enter the criteria on the
worksheet. Create a Criteria range (blue border below for illustration
only) above your data set. Use the same column headers. Be sure there's
at least one blank row between your Criteria range and data set.

And Criteria
To display the sales in the USA and in Qtr 4, execute the following steps.

1. Enter the criteria shown below on the worksheet.

2. Click any single cell inside the data set.

3. On the Data tab, in the Sort & Filter group, click Advanced.

4. Click in the Criteria range box and select the range A1:D2 (blue).

5. Click OK.
Notice the options to copy your filtered data set to another location and
display unique records only (if your data set contains duplicates).

Result.

No rocket science so far. We can achieve the same result with the normal
filter. We need the Advanced Filter for Or criteria.

Or Criteria
To display the sales in the USA in Qtr 4 or in the UK in Qtr 1, execute the
following steps.

6. Enter the criteria shown below on the worksheet.

7. On the Data tab, in the Sort & Filter group, click Advanced, and adjust
the Criteria range to range A1:D3 (blue).

8. Click OK.
Result.

Formula as Criteria
To display the sales in the USA in Qtr 4 greater than $10.000 or in the UK
in Qtr 1, execute the following steps.

9. Enter the criteria (+formula) shown below on the worksheet.

10. On the Data tab, in the Sort & Filter group, click Advanced, and adjust
the Criteria range to range A1:E3 (blue).

11. Click OK.


Result.

Note: always place a formula in a new column. Do not use a column label
or use a column label that is not in your data set. Create a relative
reference to the first cell in the column (B6). The formula must evaluate to
TRUE or FALSE.

Data Form
The data form in Excel allows you to add, edit and delete records (rows)
and display only those records that meet certain criteria. Especially when
you have wide rows and you want to avoid repeated scrolling to the right
and left, the data form can be useful.

1. Open the downloadable Excel file.


2. Add the Form command to the Quick Access Toolbar.

3. Click the Form command.

4. Use the Find Prev and Find Next buttons to easily switch from one
record (row) to another.

Note: use the New or Delete button to add or delete records. Once you
start editing a record, you can use the Restore button to undo any
changes you make.
5. To display only those records that meet certain criteria, click the
Criteria button.

6. Enter the criteria and click the Form button.

7. Now, when you use the Find Prev and Find Next buttons, you will only
see those records that meet these criteria. In our example, only record 13.
Note: to edit the criteria, click the Criteria button again. To close the data
form, click the Close button.

Remove Duplicates
To quickly remove duplicates in Excel, use the tool on the Data tab.
You can also use the Advanced Filter if you don't want to delete duplicates
permanently.

1. Click any single cell inside the data set.

2. On the Data tab, in the Data Tools group, click Remove Duplicates.

The following dialog box appears.

3. Leave all check boxes checked and click OK.

Result. Excel removes all identical rows (blue) except for the first identical
row found (yellow).
To remove rows with the same values in certain columns, execute the
following steps.

4. For example, remove rows with the same Last Name and Country.

5. Check Last Name and Country and click OK.


Result. Excel removes all rows with the same Last Name and Country
(blue) except for the first instances found (yellow).
Let's explore one more cool Excel feature that removes duplicates. If you
prefer not to delete duplicates permanently, use the Advanced Filter to
extract unique rows (or values in a column).

6. On the Data tab, in the Sort & Filter group, click Advanced.
The Advanced Filter dialog box appears.

7. Click Copy to another location.

8. Click in the List range box and select the range A1:A17 (see images
below).

9. Click in the Copy to box and select cell F1 (see images below).

10. Check Unique records only.

11. Click OK.

Result. Excel removes all duplicate last names and sends the result to
column F.
Note: at step 8, instead of selecting the range A1:A17, select the range
A1:D17 to extract unique rows.

12. Finally, you can use conditional formatting in Excel to highlight


duplicate values.

13. Or use conditional formatting in Excel to highlight duplicate rows.


Outlining Data
Outlining data makes your data easier to view. In this example, we will
total rows of related data and collapse a group of columns.

1. First, sort the data on the Company column.

2. On the Data tab, in the Outline group, click Subtotal.


3. Select the Company column, the column we use to outline our
worksheet.

4. Use the Count function.

5. Check the Company check box.

6. Click OK.

Result:
7. To collapse a group of cells, click a minus sign. You can use the
numbers to collapse or expand groups by level. For example, click the 2 to
only show the subtotals.

Note: click the 1 to only show the Grand Count, click the 3 to show
everything.

To collapse a group of columns, execute the following steps.

8. For example, select column A and B.

9. On the Data tab, in the Outline group, click Group.


10. Click the minus sign above column C (it will change to a plus sign).

Result:

11. To remove the outline, click any cell inside the data set and on the
Data tab, in the Outline group, click Subtotal, Remove all.
SUBTOTAL
Rows Hidden by a Filter | Manually Hidden Rows | Automatic Subtotals

Use the SUBTOTAL function in Excel (instead of SUM, COUNT, MAX,


etc.) to ignore rows hidden by a filter or to ignore manually hidden rows.

Rows Hidden by a Filter


1. For example, the SUM function below calculates the total sales.
2. Apply a filter.

3. The SUM function includes rows hidden by a filter.

4. The SUBTOTAL function ignores rows hidden by a filter and calculates


the correct result.
Note: 109 is the argument for Sum if you use the SUBTOTAL function.

5. It's not easy to remember which argument belongs to which function.


Fortunately, the AutoComplete feature in Excel helps you with this.

Note: instead of using 101 (AVERAGE) for the first argument, you could
also use 1 (AVERAGE), instead of using 102 (COUNT), you could also use 2
(COUNT), etc. When filtering data, there's no difference between the
numbers 101-111 and the numbers 1-11.

Manually Hidden Rows


1. For example, the SUM function below sums a range of cells.
2. Hide row 2.

3. The SUM function includes manually hidden rows.

4. The SUBTOTAL function ignores manually hidden rows and calculates


the correct result.

Caution: the numbers 101-111 ignore manually hidden rows. However, the
numbers 1-11 include manually hidden rows!

Automatic Subtotals
We saved the best for last. Excel can automatically add SUBTOTAL
functions for you.

1. The first option. Create a table and add a total row to the bottom of the
table. Next, click any cell in the last row to automatically add a SUBTOTAL
function.
Explanation: in this example, we also filtered by Country. Excel uses the
SUBTOTAL function to correctly calculate the total sales in the USA.

2. The second option. On the Data tab, in the Outline group, click Subtotal
to outline your data.

Unique Values
Extract Unique Values | Filter for Unique Values | Unique Function
| Remove Duplicates

To find unique values in Excel, use the Advanced Filter. You can extract
unique values or filter for unique values. If you have Excel 365 or Excel
2021, use the magic UNIQUE function.

Extract Unique Values


When using the Advanced Filter in Excel, always enter a text label at the
top of each column of data.

1. Click a cell in the list range.


2. On the Data tab, in the Sort & Filter group, click Advanced.

The Advanced Filter dialog box appears.

3. Click Copy to another location (see image below).

4. Click in the Copy to box and select cell C1.

5. Check Unique records only.

6. Click OK.

Result:
Note: Excel removes all duplicate values (Lion in cell A7 and Elephant in
cell A9) and sends the unique values to column C. You can also use this
tool to extract unique rows in Excel.

Filter for Unique Values


Filtering for unique values in Excel is a piece of cake.

1. Click a cell in the list range.

2. On the Data tab, in the Sort & Filter group, click Advanced.

3. Click Filter the list, in-place (see image below).

4. Check Unique records only.

5. Click OK.
Result:

Note: rows 7 and 9 are hidden. To clear this filter, on the Data tab, in the
Sort & Filter group, click Clear. You can also use this tool to filter for
unique rows in Excel.

Unique Function
If you have Excel 365 or Excel 2021, simply use the magic UNIQUE
function to extract unique values.

1. The UNIQUE function below (with no extra arguments) extracts unique


values.
Note: this dynamic array function, entered into cell C1, fills multiple cells.
Wow! This behavior in Excel 365/2021 is called spilling.

2. The UNIQUE function below extracts values that occur exactly once.

Note: the UNIQUE function has 2 optional arguments. The default value of
0 (second argument) tells the UNIQUE function to extract values from a
vertical array. The value 1 (third argument) tells the UNIQUE function to
extract values that occur exactly once.

Remove Duplicates
To find unique values (or unique rows) and delete duplicate values (or
duplicate rows) at the same time, use the Remove Duplicates tool in Excel.

On the Data tab, in the Data Tools group, click Remove Duplicates.
In the example below, Excel removes all identical rows (blue) except for
the first identical row found (yellow).
FILTER function
Use the magic FILTER function in Excel 365/2021 to extract records
that meet certain criteria. The FILTER function is quite versatile.
1. The simple FILTER function below has two arguments and extracts all
USA records.

Note: this dynamic array function, entered into cell F2, fills multiple cells.
Wow! This behavior in Excel 365/2021 is called spilling.

2. The dynamic FILTER function below extracts all UK records.


3. The FILTER function has an optional third argument. Use this argument
to display a friendly message (instead of the #CALC! error) if no records
are found.
4. Let's kick it up a notch! The FILTER function below uses the
multiplication operator (*) to extract all records where Sales is greater
than $10,000 and Country equals "USA".
5. The FILTER function below uses the addition operator (+) to extract all
records where Last Name equals "Smith" or Last Name equals "Brown".

6. Add the SORT function to sort the records by the first column.
Explanation: in this example, Excel automatically added 5 SUBTOTAL
functions (B6, B9, B13, B19 and B20). Follow the link for more information.

You might also like