Skip to main content
MyDataFixer

How to find and remove duplicate rows in Excel and CSV files

By the MyDataFixer team · Updated

The short answer

A duplicate row is a row that is the same as another row in every column. In Excel, use Data → Remove Duplicates. In Google Sheets, use Data → Data cleanup → Remove duplicates. Both keep the first copy and delete the others. Always keep a copy of the original file before you remove anything.

Why duplicate rows are a problem

One extra copy of a row may not look like much, but it changes every number that uses it. A sale counted twice makes your total too high. A customer listed twice gets two emails. A product listed twice can show the wrong stock. Charts, pivot tables and reports all include the extra rows without telling you.

Why duplicates happen

  • Copy and paste. The same block of data was pasted twice, often without noticing.
  • Joining files. Two exports were combined, and some rows were in both, for example a January and a February report that both include 31 January.
  • Forms and apps. Someone pressed “submit” twice, or an app saved the same record again after a connection problem.
  • Imports run twice. A file was imported into a system, and then imported again.

Example

Row 4 is an exact copy of row 2
Rownameemailamount
2Asha Patilasha@example.com500
3Ravi Kumarravi@example.com300
4Asha Patilasha@example.com500

The total of the amount column looks like 1,300, but the real total is 800. After removing row 4, the sheet has two customers and the right total.

Step 1: find the duplicates first

It's a good idea to look at the duplicates before you delete them. Sometimes two rows look the same but are both real, for example two separate orders of the same amount on the same day. If your sheet has an order number or ID column, rows with different IDs are usually not duplicates.

Fix it in Excel

These steps are for Excel on a Windows or Mac computer. The Excel app on phones and tablets doesn't have these menus; on a phone, use Google Sheets or MyDataFixer instead.

See the duplicates

  1. Select the column you want to check, for example the email column.
  2. Go to Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
  3. Click OK. Every value that appears more than once is coloured.

Remove the duplicate rows

  1. Save a copy of your file.
  2. Click any cell inside your data.
  3. Go to Data → Remove Duplicates.
  4. Tick My data has headers if the first row holds column names.
  5. Keep all columns ticked. Then only rows that match in every column are removed.
  6. Click OK. Excel tells you how many duplicate rows it removed and how many unique rows are left.

Fix it in Google Sheets

  1. Make a copy of the sheet (right-click the sheet tab → Duplicate).
  2. Select your data, including the column names.
  3. Go to Data → Data cleanup → Remove duplicates.
  4. Tick Data has header row if the first row holds column names.
  5. Keep all columns selected and click Remove duplicates. Google Sheets tells you how many rows were removed.

Fix it with MyDataFixer

MyDataFixer works in your browser, also on a phone or tablet, and your file never leaves your device.

  1. Open your Excel or CSV file in Remove Duplicates. The duplicate rows are found straight away.
  2. Choose how rows are compared: all columns, or only the columns you pick, such as email. You can also ignore capital letters and extra spaces.
  3. Choose which copy to keep, the first or the last, and whether to remove the other copies or just mark them in a new column.
  4. Check the preview. It shows each group of matching rows: the row that is kept and its copies. Then apply the change; Undo puts the rows back.
  5. Download the clean file as CSV, or as Excel if you opened an Excel file.

The Spreadsheet Cleaner and the Error Detector also remove exact duplicate rows in one tap, together with other fixes such as empty rows, bad dates and extra spaces.

Rows that almost match

Excel, Google Sheets and MyDataFixer remove rows that match exactly. Rows that differ in a small way are not removed, for example:

  • “Asha Patil” and “Asha Patil ” (a space at the end)
  • “asha@example.com” and “ASHA@example.com” (capital letters)
  • “500” and “500.00” in a CSV file

To catch these in Excel or Google Sheets, clean the data first: remove extra spaces and make capitalization the same, then remove duplicates. In MyDataFixer's Remove Duplicates, tick Ignore capital letters and Ignore extra spaces instead: the rows are compared that way, and the rows you keep are not changed. “500” and “500.00” still count as different.

How to avoid duplicates next time

  • Give every row an ID. An order number, invoice number or customer ID makes real duplicates easy to spot, because two rows with the same ID are almost always a mistake.
  • Check before you combine files. When you join two exports, look at the date range of each one so the same days aren't included twice.
  • Import once. Write down when a file was imported into a system, so it isn't imported again by someone else.
  • Clean regularly. Checking a shared sheet once a week takes a minute and stops small problems from growing.

Quick summary

Duplicate rows make totals and counts wrong. Look at them first, keep a copy of the original, then remove them with Remove Duplicates in Excel, Data cleanup in Google Sheets, or MyDataFixer's Remove Duplicates in your browser, which can also ignore capitals and spaces, keep the last copy, or only mark the duplicates.

Common mistakes

  • Removing duplicates by one column only. If you only compare the email column, two different orders from the same customer count as duplicates, and one of them is deleted.
  • Not keeping a copy. Once you save, the removed rows are gone. Keep the original file.
  • Forgetting the header row. Without “has header row”, the column names are treated as data.

Fix it in your browser

Free, no sign-up. Your file is processed on your device and never uploaded.

Questions and answers

Which copy is kept?

Excel and Google Sheets keep the first copy and remove the later ones. MyDataFixer's Remove Duplicates keeps the first copy too, unless you choose to keep the last.

Can I remove rows with the same email even if other columns differ?

Yes: in Excel or Google Sheets, untick every column except email; in MyDataFixer's Remove Duplicates, choose “Only the columns I choose” and tick email. Be careful, because you may delete rows that had different and useful details. Marking them first lets you check.

Is it safe to remove duplicates from a file with formulas?

Removing rows can break formulas that refer to them. MyDataFixer never removes rows that contain formulas or that formulas elsewhere in the workbook refer to.

Can I do this on my phone?

The Excel phone app doesn't have Remove Duplicates. MyDataFixer's Remove Duplicates works in the browser on phones and tablets.

Does MyDataFixer upload my file?

No. The file is checked and cleaned in your browser, on your device.