Function Problems

Excel Formula to Compare Two Pairs of Cells

Tauseeq MagsiTauseeq Magsi Nov 18, 2026 869 views

Question details

The user needs formulas to check whether each of two pairs of cells matches on every row.

How to Compare Two Pairs of Cells in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Compare the first column with the third and the second column with the fourth, using separate results for each pair.
Observed behavior
Each row should show whether the first pair matches and whether the second pair matches.
Before you start

Identify the columns to compare and choose two empty columns for the results. The examples below assume the data is in columns A through D, with the first data row in row 2.

Solution 1Recommended

Compare Each Cell Pair with an IF Formula

Use separate formulas to return Match or No Match for each pair on every row.

1
Compare the first pair

In cell E2, enter =IF(A2=C2,"Match","No Match") to compare the values in A2 and C2.

2
Compare the second pair

In cell F2, enter =IF(B2=D2,"Match","No Match") to compare the values in B2 and D2.

3
Fill the formulas down

Select E2:F2 and drag the fill handle down through the remaining data rows. Excel adjusts the row references automatically.

Compare Each Cell Pair with an IF Formula
Adjust the references: If your data starts on a different row or uses other columns, change the cell references before filling down. Two blank cells will be reported as a match.
Compare cells in WPS Spreadsheets

Compare Cell Pairs in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and use the same IF formulas to check each pair of cells, then fill the results down.

  1. 1. Open the workbook: In WPS Spreadsheets, open the workbook containing the columns you want to compare.
  2. 2. Enter the first formula: Select E2 and enter =IF(A2=C2,"Match","No Match").
  3. 3. Enter the second formula: Select F2 and enter =IF(B2=D2,"Match","No Match").
  4. 4. Fill down and save: Select E2:F2, drag the fill handle down to the last data row, and use File > Save to save your changes.
Compare two cell pairs with separate Match or No Match resultsOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interfaceFill formulas down across multiple rows
microsoft office alternative - wps office

Frequently Asked Questions

Can I check both pairs with one formula?

Yes. Enter =IF(AND(A2=C2,B2=D2),"Both Match","No Match") in an empty cell. It returns Both Match only when both comparisons are true.

Does the comparison distinguish uppercase from lowercase?

No. The = comparison is not case-sensitive for text. To make the first comparison case-sensitive, use =IF(EXACT(A2,C2),"Match","No Match").

Why do two blank cells show as a match?

The equality comparison treats two blank cells as equal. If you want a blank result when either cell is empty, use =IF(OR(A2="",C2=""),"",IF(A2=C2,"Match","No Match")).

Why might similar-looking text return No Match?

Extra spaces can make text values different. Check the cells for leading or trailing spaces, or compare cleaned text with =IF(TRIM(A2)=TRIM(C2),"Match","No Match").