Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Find Matching Cells in Excel: Step-by-Step

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To find matching cells in Excel, use conditional formatting to highlight duplicates, or use a formula such as =COUNTIF(range, cell)>1 to flag matches. For exact cell-to-cell comparisons, use =A1=B1 or =EXACT(A1,B1). These methods work in Excel for Microsoft 365, Excel 2021, 2019, and 2016 on Windows and Mac; menu labels can differ slightly by version and region.

What You'll Need

  • Excel installed on your computer (desktop version recommended for full features; web version has limited conditional formatting).
  • Your data organized in columns or rows with a clear header row.
  • Basic familiarity with selecting ranges and entering formulas.

Step-by-Step

  1. Select the range you want to check. Click the first cell, then drag to the last cell, or press Ctrl+Shift+End (Windows) or Cmd+Shift+End (Mac) to select to the end of your data. Include only the cells you want to compare; do not include headers unless you want them checked too.
  2. Open Conditional Formatting. On the Home tab, click Conditional Formatting > Highlight Cells Rules > Duplicate Values. (In Excel for the web, this option is under Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.) A dialog box appears.
  3. Choose how to highlight matches. In the Duplicate Values dialog, select “Duplicate” from the first dropdown to highlight cells that appear more than once, or “Unique” to highlight cells that appear only once. Pick a formatting style (e.g., Light Red Fill with Dark Red Text) and click OK. Matching cells are now colored.
  4. For a formula-based check, insert a helper column. Click the header of the column next to your data, right-click, and choose Insert to add a blank column. In the first cell of the helper column (e.g., B2 if your data starts in A2), enter a formula such as =COUNTIF($A$2:$A$100, A2)>1. This returns TRUE for cells that appear more than once in the range A2:A100. Adjust the range to match your data.
  5. Copy the formula down. Drag the fill handle (small square at the bottom-right of the cell) down to the last row of your data. Alternatively, double-click the fill handle to auto-fill down to the last adjacent row.
  6. Filter or sort by the helper column. Select your data including the helper column, then go to Data > Filter. Click the filter arrow on the helper column and choose TRUE to see only the matching cells. You can also use Sort to group matches together.
  7. For exact case-sensitive matches, use EXACT. In a helper column, enter =EXACT(A2, B2) to compare two cells directly. This returns TRUE if the text matches exactly, including case. Copy down as needed. Note that EXACT only compares two cells at a time; for ranges, combine with SUMPRODUCT: =SUMPRODUCT(--EXACT(A2, $B$2:$B$100))>0.
  8. To compare two columns for matches, use MATCH or VLOOKUP. In a helper column next to the first list, enter =ISNUMBER(MATCH(A2, $B$2:$B$100, 0)). This returns TRUE if the value in A2 exists anywhere in B2:B100. Copy down. Alternatively, use =IFERROR(VLOOKUP(A2, $B$2:$B$100, 1, FALSE), "No match") to return the matching value or “No match”.
  9. Remove the helper column when done. Right-click the helper column header and choose Delete to keep your sheet clean. The conditional formatting remains until you clear it via Conditional Formatting > Clear Rules > Clear Rules from Selected Cells.

Common Mistakes

  • Including headers in the range. This can cause the header to be flagged as a duplicate if it appears elsewhere, or skew COUNTIF results. Select only data cells.
  • Using relative references incorrectly. In COUNTIF, the range should be absolute (e.g., $A$2:$A$100) while the criteria cell is relative (A2) so it changes as you copy down. Mixing these up gives wrong results.
  • Forgetting that COUNTIF is not case-sensitive. “Apple” and “apple” are treated as matches. Use EXACT or SUMPRODUCT with EXACT for case-sensitive checks.
  • Assuming conditional formatting finds matches across multiple columns. Duplicate Values works within the selected range only. To compare two columns, use a formula like MATCH or VLOOKUP.
  • Overlooking hidden rows or filtered data. Conditional formatting and formulas include hidden rows unless you use SUBTOTAL or AGGREGATE. Clear filters before checking matches.

Tips

  • Use Go To Special (Home > Find & Select > Go To Special > Row differences or Column differences) to quickly select cells that differ from a comparison cell.
  • For large datasets, convert your range to an Excel Table (Ctrl+T). Formulas then use structured references like =COUNTIF(Table1[Column1], [@Column1])>1, which auto-expand.
  • Combine conditional formatting with a formula rule: select your range, go to Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter =COUNTIF($A$2:$A$100, A2)>1. This gives more control than the built-in Duplicate Values rule.
  • To find matches between two lists and extract them, use FILTER with COUNTIF: =FILTER(A2:A100, COUNTIF(B2:B100, A2:A100)>0) (Excel 365 and Excel 2021).
  • Press Ctrl+F (Windows) or Cmd+F (Mac) to open Find, which locates a specific value but does not highlight all matches at once. Use Find All to list matches in the Find dialog.

Troubleshooting

  • No cells are highlighted after applying Duplicate Values. Check that you selected the correct range and that the data actually contains duplicates. Also ensure the “Duplicate” option is selected, not “Unique”.
  • Formula returns #VALUE! or #N/A. Verify that the range references are correct and that you are comparing like data types (text vs. numbers). Use VALUE or TEXT functions to convert if needed.
  • Matches are not found when they should be. Look for leading or trailing spaces. Use TRIM in a helper column: =TRIM(A2), then compare the trimmed values. Also check for non-printing characters with CLEAN.
  • Conditional formatting does not update when data changes. Conditional formatting recalculates automatically, but if it seems stuck, press F9 to recalculate (Windows) or Cmd+= (Mac). If using a formula rule, ensure the formula uses relative references correctly.
  • Helper column shows all FALSE. Confirm that the range in COUNTIF or MATCH is absolute and covers the correct cells. A common error is using a relative range that shifts as you copy down.

Frequently Asked Questions

How do I find matching cells in two different columns?

Use a helper column with =ISNUMBER(MATCH(A2, $B$2:$B$100, 0)) or =COUNTIF($B$2:$B$100, A2)>0. Copy down and filter for TRUE to see matches.

Can I highlight matches without conditional formatting?

Yes, you can use a formula in a helper column and then manually apply a fill color, but conditional formatting is dynamic and updates automatically, so it is preferred.

Why does COUNTIF treat “Apple” and “apple” as the same?

COUNTIF is not case-sensitive by design. For case-sensitive matching, use EXACT or SUMPRODUCT with EXACT.

How do I find duplicates across multiple columns in the same row?

Use a formula like =COUNTIF(A2:C2, A2)>1 in a helper column, then copy across and down. This checks each cell against the row range.

Does Excel for the web support all these methods?

Excel for the web supports conditional formatting and most formulas, but some advanced features like Go To Special are limited. For full functionality, use the desktop app.

How can I remove duplicate values after finding them?

Select your data, go to Data > Remove Duplicates, choose the columns to check, and click OK. This permanently deletes duplicate rows, so make a backup first.