Filter Excel Rows When Two Adjacent Columns Match
Question details
Filter or extract rows where the values in two adjacent columns are equal.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains values in columns C and D, and the user wants to isolate rows where the values match.
- Observed behavior
- The desired result is a filtered view or extracted range containing only rows where the values in columns C and D are equal.
Identify the first and last data rows and confirm which columns you want to compare. The examples below assume headers in row 1 and data in rows 2 through 15.
Filter matching rows with a helper column in Excel
Use a comparison formula and Excel's filter controls to show matching rows in the original table.
In an empty column, enter a header such as Match in row 1. In the cell below it, enter =C2=D2.
Drag the fill handle from the formula cell through the last data row. Each result is TRUE when the values in columns C and D are equal and FALSE otherwise.
Select a cell in the data range, including the helper column, and choose Data > Filter.
Open the filter arrow in the Match header, select TRUE, and apply the filter. Select FALSE instead to see rows with unequal values.

Extract matching rows with the Excel FILTER function
Use a dynamic formula in Excel 365 to display matching rows in a separate range.
Filter matching adjacent columns in WPS Spreadsheets
Use a helper column and the filter controls in WPS Spreadsheets to show rows where two adjacent columns have equal values.
- 1. Open your workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
- 2. Add a comparison formula: In an empty column, enter Match as the header and type =C2=D2 in the cell below it.
- 3. Fill down: Drag the formula cell's fill handle to the last data row to compare columns C and D throughout the list.
- 4. Filter the results: Select a cell in the data range, choose Data > Filter, and use the Match column's filter arrow to show TRUE values.

Frequently Asked Questions
How do I show rows where columns C and D do not match?
Enter =C2=D2 in a helper column, fill it down, and use Data > Filter to select FALSE in that column.
Can I compare columns in an Excel table?
Yes. In a table with headers Value C and Value D, enter =[@[Value C]]=[@[Value D]] in a new table column. Use the column's filter arrow to select TRUE. Replace the example headers with your actual column names.
Why are rows with two blank cells included?
A comparison such as =C2=D2 treats two blank cells as equal. To exclude them, use =AND(C2=D2,C2<>"",D2<>"") and filter for TRUE.
Why can't the FILTER formula display its results?
The formula needs an empty output area to spill into. Clear any cells blocking the results and make sure your Excel version supports the FILTER function.




