New Tool Radar

AI for Data & Spreadsheets

How to Clean Duplicate Rows from a CSV in Excel

Remove duplicate rows from a CSV in Excel with Remove Duplicates, keyed on the columns that define a duplicate.

Schematic illustration for How to Clean Duplicate Rows from a CSV in Excel: three numbered steps - Open the CSV in Excel; Data, Remove Duplicates; Check the count removed.

A CSV export from a booking system often contains the same row twice, and a total built on it will be wrong by exactly the duplicated amount. Excel Remove Duplicates deletes the extra copies on the columns you choose, and reports how many rows it removed so the change can be checked.

Prerequisites

  • Excel
  • The CSV file, opened as a copy
  • A copy of the source file, so the original stays untouched.

Steps

  1. Open the CSV in Excel and save it as .xlsx first, so the original CSV stays untouched.
  2. Select the data, then go to Data, Remove Duplicates.
  3. Tick only the columns that define a duplicate, such as order number, and untick columns that may legitimately differ.
  4. Click OK and note how many duplicate values were found and removed, then compare the row count before and after.
  5. Sort the cleaned table and spot-check five rows against the original CSV.

Worked example: Fictional ticket orders after de-duplication

The practice table below is a fictional five-order list after duplicates were removed. Each amount is the order total, and the total is their sum. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.

Order Amount
ORD-301 18.00
ORD-302 24.50
ORD-303 12.75
ORD-304 30.00
ORD-305 9.99
Total 95.24

Expected result. Five unique orders kept, the amounts add to 95.24, and the removed rows were exact copies.

Limits

  • Remove Duplicates deletes rows permanently, so work on a copy of the CSV.
  • Two orders with the same total but different order numbers are not duplicates, so include the order number in the key.

Sources

See all