How to Filter Data from One Sheet Based on Another Sheet in Excel?

We often filter data by some criteria in its own worksheet, but if we have two or more worksheets and want to filter data from sheet1 by the criteria in worksheet2 how can we do? If we can filter data by another worksheet, then in our daily work, it will be quite helpful when we have a summary list and filter data by some details by another worksheet. This article will show your two ways to do filter data by another worksheet, you can filter data by Advanced Filter function, or COUNTIF function.

Prepare two worksheets in one Excel file, and sheet1 records the summary of name & class & score, and sheet2 only records the name.


Filter Data from One Sheet 1


Filter Data from One Sheet 2

If we only want to filter data in sheet1 by sheet2 column A, how can we do?

Filter Data Based on Another Worksheet by Advanced Filter Function

Step 1: In tool bar, click on Data->Advanced. Advanced is located just next to Filter icon.

Filter Data from One Sheet 3

Step 2: In Advanced Filter window, keep default selected option ‘Filter the list, in-place’, in List range, enter the range you want to do filter, in this case enter $A$1:$A$7. Don’t forget to add $ before cell row and column number.

Filter Data from One Sheet 4

Or you can directly click on  button to select filter range by select cells on table directly.

Filter Data from One Sheet 5

Step 3: In Criteria range, click  button to select criteria range on sheet2.

Filter Data from One Sheet 6

Then we get criteria range on Advanced Filter, see below:

Filter Data from One Sheet 7

Step 4: Click OK. Then we filter data based on shee2 column A successfully.

Filter Data from One Sheet 8

Filter Data Based on Another Worksheet by COUNTIF Function

Actually, we can use the COUNTIF function to calculate whether the data in sheet1 column A exists in sheet2 column A, and then use the filter function to filter the values that match the conditions according to sheet2 column A.

Step 1: In cell D2, enter the formula =COUNTIF(Sheet2!$A$1:$A$3,A2).

Step 2: Press Enter. Then we get return value 1. Return value 1 means we can find A2 value in sheet2 range A1 to A3, and this value occurs only once.

Step 3: Copy the cell D2 with formula to other cells like below. Then we get all return values.

Filter Data from One Sheet 11

Step 4: Do filter on column D. As we want to do filter by the criteria in sheet2 column A, so we only keep the rows which its D column value is 1. Select on D column in sheet1, click on Data->Filter, check on filter value 1, then click OK. Then we get the same result.

Filter Data from One Sheet 12

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

Match Single Criteria in Excel

No repeat statistic based on a single condition is used wildly in daily work, for example, count type of products, the duplicate types are not encountered. This article describes the way of no repeats statistics for data in a single ...

Calculate Win Loss Tie

Suppose you got a task to calculate the win, loss, and tie totals; what would you do? If you are new to Ms Excel and don't have enough experience with it, then you might do this task manually but let ...

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

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