Function Problems

Filter Excel Rows When Two Column Conditions Match

Huma Ashraf ChHuma Ashraf Ch Dec 2, 2026 868 views

Question details

Return only the rows where two separate column values match their respective criteria.

Filter Excel Rows When Two Column Conditions Match
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to display a filtered table containing rows that satisfy both column comparisons.
Observed behavior
The result should include a row only when both conditions are TRUE.
Before you start

Identify the data range, the two columns to compare, and the cells containing the criteria. Check that your Excel version supports the FILTER function and that there is an empty area for the results.

Solution 1Recommended

Use Excel FILTER with two AND conditions

Create a dynamic result table that returns rows matching both criteria in Excel 2021 or Microsoft 365.

1
Set up the criteria

Enter the first criterion in A2 and the second criterion in B2. In this example, the source data is in A4:C13.

2
Enter the formula

Select an empty cell such as E4 and enter =FILTER(A4:C13,(A4:A13=A2)*(B4:B13=B2),"No matches").

3
Review the results

Press Enter. Excel spills matching rows into the cells below and to the right; leave that area clear.

Use Excel FILTER with two AND conditions
How the conditions work: The multiplication operator combines the two comparisons as AND. A row is returned only when both comparisons are TRUE.
Filter rows in WPS Spreadsheets

Return rows matching two conditions in WPS Spreadsheets

In a version of WPS Spreadsheets that supports FILTER, use the same two-condition formula to create a dynamic result table.

  1. 1. Open the workbook: Open your spreadsheet in WPS Spreadsheets and locate the data to filter.
  2. 2. Enter the criteria: Enter the values to match in A2 and B2, with the source data in A4:C13.
  3. 3. Add the formula: Select an empty cell such as E4 and enter =FILTER(A4:C13,(A4:A13=A2)*(B4:B13=B2),"No matches").
  4. 4. Check the results: Press Enter and review the returned rows. If FILTER is unavailable in your version, use Data > Filter to filter the two columns in place.
Return rows only when both column criteria matchUpdate the results by changing the criteria cellsOpen and edit Microsoft Excel XLSX filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula use an asterisk between the conditions?

The asterisk multiplies the TRUE/FALSE results of the two comparisons, so only rows where both conditions are TRUE are included.

What happens if no rows match both criteria?

The third FILTER argument displays "No matches" instead of an empty result. You can replace that text with your preferred message.

Why does Excel show a #SPILL! error?

The result needs space to expand. Clear any occupied cells in the intended output area, starting from the formula cell.

Can I filter for either condition instead of both?

Yes. Replace the multiplication operator with a plus sign: =FILTER(A4:C13,(A4:A13=A2)+(B4:B13=B2),"No matches"). This returns rows where either condition is TRUE.