Filter Excel Rows When Two Column Conditions Match
Question details
Return only the rows where two separate column values match their respective criteria.

- 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.
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.
Use Excel FILTER with two AND conditions
Create a dynamic result table that returns rows matching both criteria in Excel 2021 or Microsoft 365.
Enter the first criterion in A2 and the second criterion in B2. In this example, the source data is in A4:C13.
Select an empty cell such as E4 and enter =FILTER(A4:C13,(A4:A13=A2)*(B4:B13=B2),"No matches").
Press Enter. Excel spills matching rows into the cells below and to the right; leave that area clear.

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. Open the workbook: Open your spreadsheet in WPS Spreadsheets and locate the data to filter.
- 2. Enter the criteria: Enter the values to match in A2 and B2, with the source data in A4:C13.
- 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. 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.

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.




