Compare Words in Excel: 5 Easy Ways to Find Differences
In this article
To compare words in Excel, the fastest method is using a simple equals formula (e.g., =A2=B2), which returns TRUE if the cells are identical and FALSE if they are different. For those who need to ignore capitalization, this standard method works perfectly. However, if you need to distinguish between "Apple" and "apple," you must use the EXACT function. Comparing words is essential for auditing lists, cleaning data, and ensuring consistency across large datasets where manual checking is impossible.
What You'll Need
- Microsoft Excel (any modern version, including Office 365, 2021, 2019, or Excel for the Web).
- Two columns of text data that you wish to compare.
- A basic understanding of how to enter formulas into a cell.
Step-by-Step
Method 1: The Basic Equals Formula (Case-Insensitive)
This is the most common way to compare two cells. It tells you if the words are the same, regardless of whether they are uppercase or lowercase.
- Open your Excel spreadsheet and ensure your two lists of words are in adjacent columns (for example, Column A and Column B).
- Click on the first empty cell in the third column (Cell C2).
- Type the formula
=A2=B2and press Enter. - If the words in A2 and B2 are the same (e.g., "Apple" and "apple"), the cell will display TRUE. If they are different, it will display FALSE.
- Hover your mouse over the bottom-right corner of cell C2 until the cursor turns into a small black cross (the Fill Handle).
- Click and drag the Fill Handle down to the bottom of your data set to apply the comparison to all rows.
Method 2: The EXACT Function (Case-Sensitive)
Use this method when capitalization matters. This is critical for passwords, product codes, or case-sensitive identifiers.
- Select the cell where you want the result to appear (e.g., C2).
- Type the formula
=EXACT(A2, B2)and press Enter. - Excel will now compare the two cells precisely. If A2 contains "Apple" and B2 contains "apple", the result will be FALSE because the casing does not match.
- Use the Fill Handle to drag the formula down the rest of the column.
Method 3: Using IF Statements for Custom Labels
Instead of seeing "TRUE" or "FALSE", you can make the results more readable by using an IF statement to create custom labels like "Match" or "Mismatch".
- Select cell C2.
- Type the formula
=IF(A2=B2, "Match", "Mismatch")and press Enter. - You can change the words inside the quotation marks to whatever you prefer, such as "Correct" and "Error".
- Drag the Fill Handle down to apply this to all your rows.
Method 4: Conditional Formatting for Visual Highlighting
If you don't want a third column of text and prefer to see the differences highlighted in color, use Conditional Formatting.
- Highlight the range of cells in the second column (e.g., B2:B100) that you want to check against the first column.
- Go to the Home tab on the top ribbon.
- Click on Conditional Formatting > New Rule.
- Select Use a formula to determine which cells to format.
- In the formula box, type
=A2<>B2(the<>symbol means "is not equal to"). Ensure the cell references match the first row of your selected range. - Click the Format button, go to the Fill tab, and select a bright color like red or yellow.
- Click OK on both windows. Now, every cell in Column B that does not match Column A will be highlighted.
Method 5: Comparing Lists Using VLOOKUP or MATCH
Sometimes your words aren't in the same row, and you just need to know if a word in List A exists anywhere in List B.
- In cell C2, type
=IF(ISERROR(MATCH(A2, B:B, 0)), "Not Found", "Found"). - The
MATCHfunction looks for the value of A2 anywhere in the entirety of Column B. - The
ISERRORfunction catches the instances where the word is not found (which would normally result in a #N/A error) and turns it into a readable "Not Found" label. - Drag the formula down to check every word in your first list.
Common Mistakes
One of the most frequent errors when comparing words is ignoring hidden spaces. A cell that looks like it contains "Apple" might actually contain "Apple " (with a trailing space). Excel treats these as different words, leading to a FALSE result when you expect a TRUE. Always check for leading or trailing spaces if your formulas aren't working as expected.
Another common mistake is using the wrong cell references when dragging formulas. If you accidentally use absolute references (like =$A$2=$B$2) instead of relative references (=A2=B2), Excel will compare every single row to the first row only, rather than moving down the list.
Users also frequently forget that the standard equals sign (=) is case-insensitive. If you are working with sensitive data where "ID101" and "id101" are different entities, using =A2=B2 will incorrectly mark them as a match.
Tips
To solve the hidden space problem, wrap your cell references in the TRIM function. For example, use =TRIM(A2)=TRIM(B2). The TRIM function removes all leading and trailing spaces and converts multiple internal spaces into a single space, ensuring you are comparing the actual text content.
For very large datasets, using Conditional Formatting can sometimes slow down your workbook's performance. In these cases, using a helper column with a simple IF formula is more efficient and makes it easier to filter the results using the Filter tool (Data > Filter) to show only the "Mismatches".
If you need to compare words across two different sheets, simply click the other sheet tab while building your formula. Your formula will look like =A2=Sheet2!A2. This is a powerful way to compare versions of a list from two different dates or sources.
Troubleshooting
The formula returns FALSE, but the words look identical: This is almost always due to non-printing characters or spaces. Try using =LEN(A2) and =LEN(B2) in two separate cells. If the length of the words differs, there is a hidden character in one of the cells. Use the TRIM function mentioned in the Tips section to fix this.
I see #NAME? in the cell: This happens if you have misspelled the function name. Check that you typed EXACT or MATCH correctly. Ensure there are no typos in the function name and that you have used commas to separate the arguments.
The Conditional Formatting isn't highlighting the right cells: This usually happens because the "Applies to" range and the formula reference are out of sync. If your range starts at B2, your formula must refer to A2. If your range starts at B1 but your formula refers to A2, the highlighting will be shifted by one row.
My formula is showing as text instead of a result: Check the cell formatting. If the cell is formatted as "Text" before you type the formula, Excel treats the formula as a literal string. Change the cell format to "General" via the Home tab, then click into the formula bar and press Enter again.
Frequently Asked Questions
Can I compare words in Excel across two different files?
Yes. Open both workbooks. While writing your formula in the first workbook, click into the second workbook and select the cell you want to compare. Excel will automatically create a reference that includes the file name in square brackets.
Is there a way to find words that are "similar" but not identical?
Standard Excel formulas cannot do "fuzzy matching" (finding words that are 80% similar). For this, you would need the "Fuzzy Lookup Add-In for Excel" provided by Microsoft or use complex VBA scripts.
How do I count how many words match between two columns?
Create a helper column using =A2=B2. Then, use the =COUNTIF(C:C, TRUE) formula to count every instance where the result was TRUE.
Can I compare a word in one cell to a specific word regardless of the cell?
Yes. Instead of comparing two cells, you can compare a cell to a text string by putting the word in quotes: =A2="Completed". This will return TRUE if the cell contains exactly that word.
Does the EXACT function work with numbers?
Yes, the EXACT function can compare numbers, but it treats them as text. If one cell is formatted as a number and the other as text, it may return FALSE even if the digits are the same.
How do I remove the TRUE/FALSE results after I'm done?
If you only need the results for a moment, you can copy the results column and use Paste Special > Values to remove the formulas. You can then delete the column or keep the static results without the formulas recalculating.