Excel Formula to Compare Two Pairs of Cells
Question details
The user needs formulas to check whether each of two pairs of cells matches on every row.

- 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.
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.
Compare Each Cell Pair with an IF Formula
Use separate formulas to return Match or No Match for each pair on every row.
In cell E2, enter =IF(A2=C2,"Match","No Match") to compare the values in A2 and C2.
In cell F2, enter =IF(B2=D2,"Match","No Match") to compare the values in B2 and D2.
Select E2:F2 and drag the fill handle down through the remaining data rows. Excel adjusts the row references automatically.

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. Open the workbook: In WPS Spreadsheets, open the workbook containing the columns you want to compare.
- 2. Enter the first formula: Select E2 and enter =IF(A2=C2,"Match","No Match").
- 3. Enter the second formula: Select F2 and enter =IF(B2=D2,"Match","No Match").
- 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.

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").




