Function Problems

Filter Excel Rows When Two Adjacent Columns Match

Amos GikundaAmos Gikunda Dec 2, 2026 868 views

Question details

Filter or extract rows where the values in two adjacent columns are equal.

Filter Excel Rows When Two Adjacent Columns Match
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.
Before you start

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.

Solution 1Recommended

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.

1
Add a comparison column

In an empty column, enter a header such as Match in row 1. In the cell below it, enter =C2=D2.

2
Fill the formula down

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.

3
Turn on filtering

Select a cell in the data range, including the helper column, and choose Data > Filter.

4
Show matching rows

Open the filter arrow in the Match header, select TRUE, and apply the filter. Select FALSE instead to see rows with unequal values.

Filter matching rows with a helper column in Excel
Check blank values: Two blank cells compare as equal. If both columns must contain a value, use =AND(C2=D2,C2<>"",D2<>"") in the helper column.
Filter matching rows in WPS

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. 1. Open your workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
  2. 2. Add a comparison formula: In an empty column, enter Match as the header and type =C2=D2 in the cell below it.
  3. 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. 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.
Filter rows by comparing values in adjacent columnsOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and filter controlsWork with spreadsheets for free
microsoft office alternative - wps office

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.