FormulaCraft

How to highlight duplicates in two columns in Excel and Google Sheets

Topic:Conditional formatting
Excel & Google Sheets
=COUNTIFS($A$2:$A$7,$A2,$B$2:$B$7,$B2)>1

Verified example

Computed by a real spreadsheet engine on the sample data below.

NameEmail
Alicealice@example.com
Bobbob@example.com
Alicealice@example.com
Charliecharlie@example.com
Daviddavid@example.com

=COUNTIFS($A$2:$A$7,$A2,$B$2:$B$7,$B2)>1TRUE

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Select the range of cells you want to check for duplicates (e.g., A2:B7).
  2. 2Go to the Home tab, click Conditional Formatting, and choose New Rule.
  3. 3In Excel, select 'Use a formula to determine which cells to format'. In Google Sheets, choose 'Custom formula is'.
  4. 4Enter the formula provided for your respective application.
  5. 5Set your desired formatting style and click OK.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

What if my data is in different columns?

Adjust the column references in the formula to match your data's location.

Can I highlight duplicates in more than two columns?

Yes, extend the COUNTIFS formula to include additional criteria for each column.

How do I remove the highlighting once I've identified duplicates?

Select the formatted cells, go to Conditional Formatting, and delete the rule.

More on Conditional formatting

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: