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

Break ties with helper COUNTIF and column

Suppose you got a task to adjust the values that contain the ties; what would be your first attempt to break the ties of the given value? If you are wondering about doing this task manually, let me add that ...

Sort/Rank Numeric Values with Duplicate Values Exist

Excel built-in RANK function can sort a set of values. If there are duplicate numbers, then the rank number is also duplicated. See the following example: There are two numbers “100” in range A2:A9, they are both the third largest ...

Count Attendance and Absence with COUNTIF function
Count Attendance and Absence1

In our campus life and work life, we usually record everyone's attendance. Today we will introduce you the application of Excel COUNTIF function to count the attendance. Using a week as an example, we use the following example to show ...

Count Cells that are Case Sensitive
count cell that contain case sensitive1

If you are a frequent user of Microsoft Excel, you may have come across situations where you needed to add or count the cells that were case-sensitive. If you have done this task manually, I would like to point out ...

Check Dates in chronological order
sort dates in chronological order1

Assume you have a date list that has different date formats, as seen in the accompanying picture. In this instance, Excel's Sort function will fail to sort them appropriately. However, you may convert all various date formats to a particular ...

Check If a Cell is Blank or Empty
check if a cell is blank 1

The article demonstrates how to check if a range of cells is blank or empty by ISBLANK and other functions to recognize empty cells in Excel and take appropriate action based on their status. There are several circumstances in which ...

Extract matching values From Two Lists
extract matching values from two list1

Suppose that you are working with two lists containing few values, and you want to extract the matching values from those two lists into another separate list. You might prefer to manually extract the matching values from the two lists, ...

Extract Common Values in Two Lists

Just assume that you have two lists containing values/words in the few cells, and you want to extract the same or common values/words from the two lists into another separate list; then you might think that it's not a big ...

Extract Unique Items From A List
Extract Unique Items From A List In Excel1

This post will guide you how to extract unique itmes from a given list in Microsoft Excel. How to create a newly formula to get unique values from a range cells in Excel. The unique list of items is the ...

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 ...

Sidebar