Compare two cells

You can compare text in Excel to check whether two cells contain the same wording. These examples use two aligned columns: the original in A and the updated value in B.

If your original text is in A2 and the second version is in B2, enter =A2=B2 in C2. The result is TRUE when the values match and FALSE when they differ. For text, this comparison does not distinguish uppercase and lowercase.

Make the comparison case-sensitive

Use =EXACT(A2,B2) when capitalization matters. Microsoft's EXACT function treats “Word” and “word” as different. Spaces also matter: “w ord” and “word” do not match. Cell formatting such as font or color is not compared.

A2B2=A2=B2=EXACT(A2,B2)
WordwordTRUEFALSE
hellohelloTRUETRUE
a babFALSEFALSE

Label rows as Match or Different

For easier scanning, use =IF(EXACT(A2,B2),"Match","Different") and fill the formula down the comparison column. The IF function chooses a label based on the comparison result. Formula separators and function names can vary with your Excel language settings.

These formulas compare the two cells on the same row. If records have moved, align them by a reliable identifier first; otherwise a row-by-row comparison may flag unrelated records.

Highlight rows with different text

  1. Select the rows to check, such as A2:B100, with A2 as the active cell.
  2. In Excel for Windows desktop, choose Home → Conditional Formatting → New Rule, then the option to use a formula.
  3. Enter =NOT(EXACT($A2,$B2)) for a case-sensitive comparison.
  4. Choose a fill color and apply the conditional formatting rule. Both selected cells in a differing row are highlighted.

For a comparison that ignores capitalization, use =$A2<>$B2 instead. The dollar signs keep the columns fixed while the row number changes. This highlights differing rows; it does not find matching records elsewhere in the other column. Menu labels can differ in Excel for Mac and the web.

Decide whether extra spaces should matter

Use =EXACT(TRIM(A2),TRIM(B2)) to ignore leading and trailing ordinary spaces and reduce repeated spaces between words to one. For example, “ hello ” and “hello” match, while “a b” and “ab” still differ. The TRIM function does not remove every kind of whitespace; nonbreaking spaces copied from websites need separate cleanup. Keep the original columns so you can check what changed during cleanup.

Find the words that changed

Excel’s equality and EXACT formulas tell you whether cells match; they do not highlight individual edited words. To review the wording in a long cell, copy both values into the text compare tool. To compare whole workbooks, formulas, or cell formatting, use Microsoft’s workbook comparison guidanceand check the supported Excel edition.