Remove duplicates from a large file

Excel’s Remove Duplicates button works well, up to the 1,048,576 rows a sheet can hold, and as long as the file opens at all. Past that, duplicates hide in the rows Excel never loaded. This guide covers how to define a duplicate, how to remove them on millions of rows without losing the wrong ones, and how to check the result.

Updated

Why large files are full of duplicates

Duplicates are rarely a mistake made once. They come from the way data is assembled: two monthly exports that overlap by a day, a CRM where the same customer signed up twice with “Dupont” and “DUPONT ”, a log that repeats an event on retry, or files combined from several branches that each kept a copy of the shared customers.

The bigger the file, the more likely it is to be built that way, and the more a few percent of duplicates distort the results: a customer count, an average basket, a conversion rate.

Step one: decide what counts as a duplicate

This is the decision that matters, and no tool can make it for you. A duplicate can mean two different things.

  • An exact duplicate: two rows identical in every column. Removing them is always safe. It is the case of an export run twice, or two files that overlap.
  • A duplicate on a key: two rows that share an e-mail address, a customer ID or an order number, but differ elsewhere, for example a phone number updated later. Removing them means choosing which row to keep.

The fewer columns you compare on, the more rows count as duplicates. Comparing on the e-mail alone can merge two people who share a family address. Comparing on every column misses the same customer with a new phone number. Start with the narrowest key that identifies one real thing, and check a few groups by hand.

Step two: choose which row to keep

When rows differ outside the key, the one you keep matters. Sort first so that the row you want comes first or last in each group: by date to keep the most recent record, by completeness to keep the row with a phone number. Then keep the first or the last row of each group.

Remove duplicates in Big Sheets

Big Sheets is a spreadsheet that opens several million rows in the browser. Its Remove duplicates works on the whole file, not on the first million rows.

  1. Open your file in Big Sheets: CSV, Excel, Parquet, JSON or XML. Several files can be combined into one sheet first, with a column that names each row’s source.
  2. If you want to keep the most recent row of each group, sort by date first.
  3. Open Remove duplicates. Under Compare on, tick the columns that define a duplicate, for example only the e-mail.
  4. Tick Ignore case and Ignore spaces at either end, so that “Dupont” and “DUPONT ” count as the same value.
  5. Choose to keep the first row of each group, or the last.
  6. Read the count: Big Sheets tells you how many rows will be removed before anything is deleted. If the number surprises you, change the columns.
  7. Confirm. The step can be undone with Ctrl+Z, and it is recorded in the process, so you can replay it on next month’s file.

Find duplicates without deleting them

Sometimes the goal is to see the duplicates, not to delete them: to send a list of duplicate customer records to the CRM team, or to understand where they come from. Two ways to do it:

  • Summarize: group by the key and add a Count. The result is a new sheet with one row per key; filter it on counts greater than 1 to list every duplicated key and how many times it appears.
  • A pivot table with the key in Rows and a Count in Values shows the same counts, and a double-click on a number opens the rows behind it.

Check the result

  • Compare the row count before and after. The difference should match the count announced before you confirmed.
  • Filter on a few keys you know were duplicated and check that one row remains, the one you wanted.
  • Look at the near-duplicates that were not caught: “Jean-Pierre” and “Jean Pierre”, or an e-mail with a typo. Clean those values first with a formula or a replace, then run Remove duplicates again.
  • Keep the original file. Big Sheets never modifies the file on your disk; export the cleaned sheet under a new name.

If you must stay in Excel

  • Data › Remove Duplicates, on a sheet under 1,048,576 rows. Excel tells you how many rows it removed only after removing them, so copy the sheet first.
  • Power Query’s Remove Duplicates works on the loaded query, beyond the sheet limit, and keeps the first row of each group. It is case-sensitive by default.
  • Split the file with the free CSV splitter and remove duplicates in each part. This misses duplicates that sit in different parts, which is exactly where overlapping exports put them.

Private data stays private

Customer lists are the files most often deduplicated, and the ones you should least upload to an online tool. Big Sheets reads them in your browser; your rows never leave your device. Try it on the sample data first, no account needed.

Try it on your own file

Open it in Big Sheets: no sign-up, and your file never leaves this browser.

One plan: €29 incl. VAT per month, everything included, cancel any time. See pricing

Questions

Which row is kept in each group of duplicates?
You choose: the first or the last row of each group. Sort beforehand so that the row you want comes first or last.
Does “DUPONT” match “Dupont ”?
Yes, if you tick Ignore case and Ignore spaces at either end. Otherwise they are different values.
Can I find duplicates without deleting them?
Yes. Big Sheets counts them before you remove anything, and Summarize with a count per key lists them in a new sheet.
Does it work on a file larger than Excel allows?
Yes. Big Sheets is tested on files up to 5 million rows, and your file is not uploaded.