To find duplicate entries in Excel with a formula, use COUNTIF. For a list in column A starting at A2, enter =COUNTIF($A$2:$A$100,A2)>1 in B2 and fill down. Every row that returns TRUE is a duplicate. This works in Excel for Microsoft 365, Excel 2021, 2019, 2016, and Excel for the web. The formula compares each cell against the whole range, so the first occurrence is flagged too. If you want only the second and later occurrences marked, use =COUNTIF($A$2:A2,A2)>1 instead.

What You'll Need

  • A version of Excel that supports COUNTIF (all modern versions do).
  • A column or range of data to check. The examples below use column A, rows 2 to 100.
  • An empty column next to your data for the formula results.
  • Optional: Excel's Filter or Conditional Formatting if you want to hide or highlight duplicates visually.

Step-by-Step

  1. Set up a helper column. Click the header of the first empty column to the right of your data (for example B1) and type a label such as Duplicate?. This keeps the formula results separate from your source data.
  2. Select the first data cell. Click cell B2, which sits next to the first entry in A2.
  3. Enter the COUNTIF formula. Type =COUNTIF($A$2:$A$100,A2)>1 and press Enter. The dollar signs lock the range so it does not shift when you copy the formula down. Adjust the 100 to match the last row of your data.
  4. Copy the formula down. Click B2, then double-click the small square at the bottom-right corner of the cell (the fill handle). Excel fills the formula down to the last row of adjacent data. Alternatively, drag the fill handle down manually.
  5. Read the results. TRUE means the entry appears more than once in the range. FALSE means it is unique. Both the first and later occurrences return TRUE with this version of the formula.
  6. Mark only later duplicates (optional). If you want the first occurrence to stay FALSE, replace the formula in B2 with =COUNTIF($A$2:A2,A2)>1 and fill down. The range grows by one row each time, so the first match is not counted.
  7. Filter to see duplicates. Select the header row, go to the Data tab, and click Filter. Open the filter arrow on the Duplicate? column and tick only TRUE. The sheet now shows only duplicated rows.
  8. Highlight duplicates visually (optional). Select your data range, go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. Choose a format and click OK. This colours duplicates without a helper column, but it does not give you a TRUE/FALSE value you can filter on.
  9. Remove duplicates if needed. Select the data range, go to Data > Remove Duplicates, tick the columns to check, and confirm. Excel permanently deletes the extra rows, so copy your data to a backup sheet first if you might need it.

Common Mistakes

  • Forgetting the dollar signs. Without $A$2:$A$100, the range shifts as you fill down and the results become wrong. Always lock the range with $ signs.
  • Mismatched range size. If the range in COUNTIF is smaller than your data, rows outside it are never checked. Make the range cover every row you want to test.
  • Trailing spaces. "Apple" and "Apple " look the same but COUNTIF treats them as different. Use TRIM in a helper column first if your data comes from imports or copy-paste.
  • Case sensitivity. COUNTIF is not case-sensitive, so "apple" and "APPLE" count as duplicates. If case matters, use SUMPRODUCT with EXACT instead.
  • Numbers stored as text. A number and the same number stored as text may not match. Check with the ISTEXT or ISNUMBER functions if results look odd.
  • Using whole-column references on huge sheets. COUNTIF over an entire column (A:A) is slow on very large workbooks. Limit the range to the rows you actually use.

Tips

  • Use =COUNTIF($A$2:$A$100,A2) without >1 if you want the actual count of each entry rather than a TRUE/FALSE flag.
  • Combine COUNTIF with IF for a friendlier label: =IF(COUNTIF($A$2:$A$100,A2)>1,"Duplicate","Unique").
  • To check duplicates across two columns (for example first name and last name together), use COUNTIFS with both ranges and both criteria.
  • Convert your data range to an Excel Table (Ctrl+T) so formulas fill automatically as you add rows.
  • Keep a backup copy before using Remove Duplicates, because that command cannot be undone with Ctrl+Z after saving.

Troubleshooting

  • The formula returns #VALUE! or #NAME? Check for a typo in COUNTIF and make sure you are using a comma or semicolon as the argument separator, depending on your region settings.
  • Every row shows FALSE. Your range may not include the cells you think it does, or the data may contain hidden spaces. Test with a single known duplicate by typing its exact value into a blank cell and comparing.
  • Every row shows TRUE. The range is probably a single cell rather than a full column, or the criteria cell is empty and matches blank cells in the range.
  • The fill handle does not copy the formula. Check that the adjacent column is not empty; double-click fill needs contiguous data on the left. Drag the handle manually instead.
  • Conditional formatting highlights nothing. Make sure the rule is applied to the correct range and that the Duplicate Values option, not a formula rule, is selected.
  • Remove Duplicates deletes more than expected. Restore from a backup or from version history in OneDrive or SharePoint. Next time, run the COUNTIF check first to see exactly which rows will be affected.

Frequently Asked Questions

Can I find duplicates without a helper column?

Yes. Conditional Formatting > Highlight Cells Rules > Duplicate Values colours duplicates directly. You lose the TRUE/FALSE output, so filtering is harder, but the sheet stays cleaner.

Does COUNTIF work in Excel for the web and Google Sheets?

Yes. COUNTIF behaves the same in Excel for the web and in Google Sheets, including the dollar-sign locking. Menu labels for Conditional Formatting differ slightly between the two.

How do I count duplicates only once per value?

Use =SUMPRODUCT((COUNTIF(A2:A100,A2:A100)>1)/COUNTIF(A2:A100,A2:A100)) to count how many distinct values are duplicated, rather than counting every duplicate row.

Why does COUNTIF treat "Apple" and "apple" as the same?

COUNTIF ignores case by default. For case-sensitive checks, use =SUMPRODUCT(--EXACT(A2,$A$2:$A$100))>1, which compares exact text including case.

Can I check duplicates across multiple columns?

Yes. Use COUNTIFS with one range and criteria pair per column, for example =COUNTIFS($A$2:$A$100,A2,$B$2:$B$100,B2)>1. This flags rows where the combination of values repeats.

What is the difference between COUNTIF and Remove Duplicates?

COUNTIF only reports duplicates and leaves your data untouched. Remove Duplicates permanently deletes the extra rows, so back up the sheet before using it.