How to Filter Data Based on Another List Selection in Excel

We can do filter data by some certain criteria for a list or a table in excel. And if the criteria is another list selection in worksheet, how can we filter data from original selected range refer to the new list selection? This article will provide you two methods to filter data based on another list selection by COUNTIF Formula or Advanced Filter Function in excel, you can select one you like to use it in your daily work.

Why we need to learn how to filter data based on another list selection? Actually, we often get a summary (filter range) from others and we just want to get part information by some criteria (criteria range, usually it is another list), see the example below.

Filter Data Based on Another List 1

In above table column A, B, C list all students’ Names, IDs and Scores. We want to get ID and Score for class1 and class2 students, we need to filter data from the filter range based on the name list of class1 and class2. Now, you can follow below steps to filter data by different methods.

Method 1: Filter Data Based on Another List Selection by Formula


Step 1: First, we need to find out which names included in column A also belong to Class1. We can use COUNTIF function to mark these names. In cell D2, enter the formula =COUNTIF($F$2:$F$6, A2). Then click Enter. Verify that we get return value ‘1’ in D2.

Filter Data Based on Another List 2

Filter Data Based on Another List 3

Step 2: Drag the fill handle down to fill all cells. Then we can find that names belong to class1 are marked with number ‘1’.

Filter Data Based on Another List 4

Step 3: Create a filter on column D. Select on column D, click on Data->Filter, then click dropdown list, only check on number ‘1’, then click OK.

Filter Data Based on Another List 5

Verify that all names belong to class1 are listed properly with ID and Score.

Filter Data Based on Another List 6

Step 4: Select all filtered data, click F5, on Go To dialog click on Special button, then check on ‘Visible cells only’, then click OK.

Filter Data Based on Another List 8

Step 5: Copy and paste the selected data to criteria range accordingly.

Filter Data Based on Another List 10

Filter Data Based on Another List 11

We can repeat above steps to filter data for class2.

 

Method 2: Filter Data Based on Another List Selection by Advanced Filter


Step 1: Select data you want to do filter, in this case we select A2:C11, select Data->Advanced.

Filter Data Based on Another List 12

Step 2: On Advanced Filter dialog, check on ‘Filter the list, in-place’, in List range select $A$2:$A$11, in Criteria range, select $F$2:$F$6. Then click OK.

Filter Data Based on Another List 13

Filter Data Based on Another List 14

Step 3: After above steps, names are filtered properly.

Filter Data Based on Another List 15

Step 4: Repeat step#4-5 in method 1 to copy and paste filtered data to criteria range.

Related Functions


  • Excel COUNTIF function
    The Excel COUNTIF function will count the number of cells in a range that meet a given criteria. This function can be used to count the different kinds of cells with number, date, text values, blank, non-blanks, or containing specific characters.etc.= COUNTIF (range, criteria)…

 

Related Posts

If Cell Equals Certain Text String
If cell equals certain text_1

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if cell equals a certain text string like “Win”, you ...

If Cell Contains Either Text1 or Text2
If cell contains text1 or text2_1

IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to see if cell contains certain substring1 like “abc” or substring2 like “def”, and returns true ...

If Cell Begins with One of Three Supplied Characters
If Cell Begins with One of Three Supplied Characters

If you want to test values to see if they begin with some given specific characters like “x”, ”y”, or “z”, you can create a formula with COUNTIF and SUM functions to return results. EXAMPLE You can see “TRUE” or ...

Average per Week by Formula in Excel
Average per Week 1

We usually apply AVERAGE function or relevant functions to return average directly in Excel worksheet. But in some situations, only applying average relevant functions cannot figure out our problem. Sometimes we can create a formula with functions and mathematical operation ...

How to Statistic Pass 4 Out of 5 Rounds in a Competition by Excel Functions
Statistic Pass 4 Out of 5 Rounds 1

Suppose you are counting the numbers of participants who are the winners in a competition. And the passing line is provided as pass 4 out of 5 rounds of games. You need to know if participant pass the game or ...

How to Subtotal Values for Groups and Only Keep One Subtotal for A Group in Column
How to Subtotal Values for Groups and Only Keep One Subtotal for A Group in Column14

Sometimes we may meet the case that subtotal values for different groups and only record a subtotal value for one group in a column, for other cells in this group, keep them blank. Today we will introduce you how can ...

Running Count of Occurrence List
running count of occurrentce in list2

This post will guide you how to get running count of an occurrence in a list with formula in Excel 2013/2016 or Excel office 365. How to create a running count of certain values that appear in the given range ...

Count Non-Contiguous Range using COUNTIF
count non-contiguous ranges 2

This post will guide you how to count a non-contiguous range with criteria in COUNTIF function in Excel 2013/2016 or Excel office 365. How do I build a formula for counting non-contiguous range in Excel using COUNTIF function in Excel. ...

How to Count Unique Numeric Values in a Range in Excel
count unique numberic values7

This post will guide you how to count unique numeric values in the given range in Excel 2013/2016 or Excel office 365. How do I count the unique numeric values in a list of data with some duplicate values using ...

How to Count Unique Dates in Excel

This post will guide you how to count unique dates in a given range in Excel 2013/2016 or Excel office 365. How do I count the unique dates in a list of dates with some duplicate dates using a formula ...

Sidebar