Smart Systems for Home

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

How to Find Duplicates in Excel

· 7 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

Yes, you can find duplicates in Excel using built-in functions, conditional formatting, or the Remove Duplicates tool. The best method depends on whether you want to highlight existing duplicates, identify which rows are unique, or permanently delete them from your dataset. This guide covers the most accurate and practical ways to detect and manage duplicate data in spreadsheets.

What You'll Need

  • A computer with Microsoft Excel installed (Desktop version for Windows or macOS, or the web version via a browser).
  • A dataset in Excel containing the columns you want to check for duplicates (for example, a list of names, order numbers, or email addresses).
  • A basic understanding of Excel formulas or the ability to navigate the Home and Data tabs.

Step-by-Step

  1. Select your data range. Click on any cell within the column or range of cells you want to check for duplicates. If you want to check an entire table, click the top-left cell and drag to the bottom-right corner, or press Ctrl + A (Windows) or Cmd + A (Mac) to select all contiguous data.
  2. Open the Conditional Formatting menu. Navigate to the Home tab at the top of the Excel ribbon. In the Styles group, click the Conditional Formatting button. From the dropdown list, select Highlight Cells Rules and then choose Duplicate Values.
  3. Choose the duplicate style. A dialog box titled "Duplicate Values" will appear. Excel automatically selects "Duplicate" in the left dropdown menu. In the right dropdown menu, choose the formatting style you prefer. Common options include "Light Red Fill with Dark Red Text" or "Custom Format" to apply your own colors or fonts.
  4. Apply the formatting. Click the OK button. Excel will immediately scan the selected range. Any cell containing a value that is identical to another cell in the same range will be highlighted with the chosen color. This visual cue allows you to quickly spot rows that need review.
  5. Use the Remove Duplicates tool (for permanent deletion). If you want to delete duplicate entries from your dataset, go back to the Home tab. In the Data Tools group, click the Remove Duplicates button. Select Remove Duplicates from the dropdown menu.
  6. Select the columns to check. A dialog box titled "Remove Duplicates" will open. By default, Excel checks all columns in your selected range. If you only want to remove rows that are duplicates across specific columns (for example, first name and last name combined), deselect the columns you do not want to include in the check.
  7. Confirm the action. Click the OK button. Excel will display a popup message indicating how many duplicate values were found and how many unique values remain in your selection. Click OK again to finalize the changes. Note that this action is permanent and cannot be undone with the Undo button if you have closed the file or performed other actions since then.
  8. Use the COUNTIF function (for a formula-based approach). If you need a formula to check duplicates dynamically or want to list them in a separate column, insert a new column next to your data. In the first cell of this new column, type the following formula: =COUNTIF(A:A, A2)>1 (assuming your data is in column A and you are writing the formula in cell B2). This formula counts how many times the value in cell A2 appears in the entire column A.
  9. Drag the formula down. Click the bottom-right corner of the cell containing the formula and drag it down to apply it to the rest of your rows. If the result is TRUE, it indicates that the value in column A is a duplicate. If the result is FALSE, the value is unique.
  10. Filter for duplicates. You can now use the filter on your new column to hide all the unique values and view only the duplicates. Click the filter arrow in the header of the new column, uncheck the box for "FALSE", and click OK. The rows containing duplicates will remain visible, allowing you to edit or delete them manually.

Common Mistakes

One of the most frequent errors when finding duplicates is selecting the wrong range. If you include a header row in your selection when using the COUNTIF function, the formula will treat your header text as a data point, potentially flagging your header as a duplicate of itself if it appears elsewhere. Always ensure your formula range starts from the first row containing data and excludes the header row.

Another common mistake is relying on visual inspection alone. Conditional formatting highlights duplicates, but it does not tell you which row is the original and which one is the duplicate. If you are trying to keep the first instance of a value and remove the rest, you must manually review the highlighted rows or use the Remove Duplicates tool, which is designed to keep the first occurrence and delete subsequent ones.

When using the Remove Duplicates tool, users sometimes forget that the tool operates on the selected range, not the entire worksheet. If you have data in multiple columns and want to check for duplicates across those columns, you must select the entire block of data before clicking the button. If you only select a single column, the tool will only look for duplicates within that specific column.

Tips

To check for duplicates across multiple columns at once, use the Remove Duplicates dialog box to deselect the columns you do not want to include in the check. This allows you to treat a combination of values as a single unique identifier (for example, checking for duplicate email addresses separately from names).

For large datasets, the Remove Duplicates tool is significantly faster than filtering or deleting rows manually. However, it is always wise to save a copy of your file before running this tool, just in case you need to restore the original data.

If you are working with a dataset that has inconsistent formatting (for example, "John Doe" vs "john doe" or "JOHN DOE"), the duplicate detection functions will treat these as different values. You may need to clean your data by converting text to lowercase or trimming spaces before checking for duplicates to ensure an accurate result.

Troubleshooting

If conditional formatting does not highlight any duplicates, the most likely cause is that the selected range does not include all the data. Double-check that you have selected the entire column or range of cells you intended to check. If you are using the COUNTIF function and getting all FALSE results, verify that the range in the formula matches the column containing your data. A common error is using =COUNTIF(A:A, A2)>1 when the data is actually in column B.

If the Remove Duplicates tool is not removing the duplicates you expect, ensure that the data is formatted consistently. For example, if one cell contains the number 100 and another contains the text "100", Excel will not consider them duplicates. You may need to convert text to numbers or vice versa using the "Convert Text to Columns" feature or the VALUE/TEXT functions.

If the file becomes unresponsive while processing a very large dataset, try closing any other applications that may be using system resources. Excel may also hang if the file is corrupted. In this case, try opening the file in Safe Mode by holding the Ctrl key while double-clicking the Excel icon, or try opening the file in the Excel web version if available.

Frequently Asked Questions

Can I find duplicates across multiple columns at once?

Yes, you can. When using the Remove Duplicates tool, simply select the entire range of data you want to check. Then, in the dialog box, you can uncheck any columns you do not want to include in the duplicate check. The tool will only remove rows where all selected columns contain identical values.

Does the Remove Duplicates tool keep the first occurrence?

Yes, the Remove Duplicates tool is designed to keep the first occurrence of a unique value and remove all subsequent duplicates. It does not offer an option to keep the last occurrence instead.

How do I check for duplicates in a specific column only?

To check for duplicates in a specific column, simply select that column before applying Conditional Formatting or clicking the Remove Duplicates button. If you select a larger range that includes other columns, the tool will check for duplicates across the entire range, not just the selected column.

What is the difference between Conditional Formatting and Remove Duplicates?

Conditional Formatting highlights duplicates visually, allowing you to see them without changing the data. Remove Duplicates permanently deletes the duplicate rows from your spreadsheet. Use Conditional Formatting for review and analysis, and Remove Duplicates for cleaning your data.

Can I use a formula to list all unique values?

Yes, you can use the UNIQUE function, which is available in newer versions of Excel. This function returns a list of unique values from a specified range. For example, =UNIQUE(A:A) will list every unique value in column A. In older versions of Excel without the UNIQUE function, you would need to use the Advanced Filter feature to extract unique records.

Why are my duplicates not being found?

Duplicates may not be found due to hidden spaces or inconsistent formatting. For example, "John Doe" and "John Doe " are not considered duplicates because of the trailing space. Ensure your data is clean and formatted consistently before checking for duplicates.