top of page

You are learning Sorting and Filtering in MS Excel

How to filter data based on another cell's value in Excel?

There are two main methods to filter data based on another cell's value in Excel:

Method 1: Using Advanced Filter (Classic Approach)

1. Define your criteria: Enter the criteria you want to filter by in another cell (separate from your data). For example, if you want to filter for items containing "apple" in a product list, enter "apple" in a designated cell (e.g., cell E1).
2. Copy your data: Select the entire data range you want to filter (including headers). Copy the data (Ctrl+C).
3. Choose a destination: Choose a blank area of your worksheet where you want the filtered results to appear. Paste the copied data (Ctrl+V) there.
4. Go to Advanced Filter: Navigate to the "Data" tab. In the "Data Tools" group, click "Advanced."
5. Set up the filter:
- Action: Choose "Copy to another location."
- Copy to: Enter the cell address where you want the filtered data to start (the top-left corner of your pasted data range).
- Criteria range: Select the cell containing your filter criteria (e.g., cell E1).
6. Copy headers: Check this box if you want to copy the header row to your filtered results.
7. Click OK: Click "OK" to run the advanced filter and display the data matching your criteria.

Method 2: Using FILTER Function (Modern Approach - Excel 365 & Excel 2019 with Dynamic Arrays)

1. Enter the FILTER formula: In the cell where you want your filtered data to appear, type the formula `=FILTER(data_range, criteria_range, [extract_range])`.
- data_range: This is the range of your data you want to filter (including headers).
- criteria_range: This is the cell containing your filter criteria (e.g., cell E1).
- extract_range (optional): If you only want to display specific columns from the filtered data, enter the range of those columns here. Otherwise, leave it blank to display all columns.
2. Press Ctrl+Shift+Enter: Since FILTER is a dynamic array function, press Ctrl+Shift+Enter instead of just Enter to confirm the formula and display the filtered results.

Note: The first method (Advanced Filter) works in all Excel versions, while the second method (FILTER function) requires Excel 365 or Excel 2019 with dynamic arrays enabled. Choose the method that best suits your Excel version and preference.

These methods allow you to dynamically filter your data based on the value in another cell, providing a flexible way to explore and analyze your information.

bottom of page