How I can create an excel filter that checks the value from one table with the range of…
- User
How I can create an excel filter that checks the value from one table with the range of another table and leaves only the value that match
- Assistant
Creating a filter in Excel that checks values from one table against the range of another table and filters based on matches requires a combination of formulas and features in Excel. The most straightforward way to achieve this is by using helper columns with a combination of
MATCH,INDEX,VLOOKUP, or newer dynamic array functions likeFILTERandXLOOKUP(if you're using Excel 365 or Excel 2019), depending on your specific case. I'll guide you through a basic example using helper columns and theMATCHfunction.Example Scenario
- Table 1 is located in
A1:A5and contains the values you want to filter. - Table 2 is the reference range located in
C1:D5. For simplicity, let's assume this table has a single column of values you want to match against, inC1:C5. - You want to filter values in Table 1 (
A1:A5) to show only those that also appear in Table 2 (C1:C5).
Step 1: Create a Helper Column
-
Next to your first table (
A1:A5), in cellB1, start by entering a formula to check if each value in Table 1 exists within Table 2. -
Use the
MATCHfunction:=IF(ISNUMBER(MATCH(A1, $C$1:$C$5, 0)), "Match", "No Match") -
Drag the fill handle (small square at the bottom right corner of the cell) down to apply this formula to the rest of the cells in column B corresponding to your list in column A.
Step 2: Filter Based on the Helper Column
- Select your range (including the helper column). In this example, select from
A1:B5. - Go to the Data tab on the Excel ribbon.
- Click on Filter. This will apply filter drop-downs at the top row of your selected range.
- Click the drop-down in the helper column (in our example,
B1) and select "Match" to filter the rows that only have the value "Match".
Optional: Using Dynamic Array Functions (For Excel 365 or Excel 2019)
If your version of Excel supports dynamic array functions, you can use
FILTERfunction:=FILTER(A1:A5, ISNUMBER(MATCH(A1:A5, C1:C5, 0)))This formula will directly return an array of values from Table 1 (
A1:A5) that are found in Table 2 (C1:C5), without needing a separate filter step. You just need to paste this formula in a new cell, and it will automatically spill the filtered values if you're using Excel with dynamic array support.Conclusion
The exact approach might need adjustments based on your specific data setup, such as handling multi-column tables or more complex matching criteria. Remember that Excel allows a lot of flexibility, so you might combine or tweak these ideas to match your exact requirements.
- Table 1 is located in