A shop owner exports a list of orders at the end of every month. At first it takes ten minutes to fix the date column and delete repeated customer names. By Christmas, some orders have vanished from a report. The people who would know why the rows disappeared remember only that the list looked cleaner afterward.

The better objective is a sheet that another person can explain. Keep the export, set rules before making irreversible changes, and store the evidence that the cleanup kept the information it was meant to keep.

Keep a copy of the raw input

Give each export a name that records source and date. Save it where ordinary report editing cannot overwrite it. Set up a working workbook with three obvious locations for raw data, edits, and output, or import the export into a repeatable query. Preserve the export before opening and resaving it, especially if the source is a CSV. Spreadsheet applications can interpret apparent dates and numbers as soon as they read the file.

Open a copy and look at the top, middle, and bottom of the data. Identify decorative headers, section totals, blank lines, tiny notes at the end, and columns kept as part of the real records. Count records before changing anything. If the file has a separate summary header you will exclude, record how you counted. Later, a mismatch will be the beginning of an investigation instead of an awkward surprise.

Give special care to identifiers. An order code such as 00217 is a label, even though it contains digits. The zero is meaningful if another system uses it to match records. Store it as text in the working data. A quantity or price needs a numeric type so arithmetic behaves as expected, while a telephone number or postal code rarely needs arithmetic.

Define what a row represents

Write a sentence in the workbook explaining what one row means. It might represent one order, one product shipped within an order, or one update to a shipment. Each interpretation changes which values can legitimately repeat. If the file contains two items sold in the same order, the order number is supposed to repeat. If the export is a list of orders with one row per order, repetition might indicate a duplicate or a correction.

Choose the columns that identify a row. If a compound key consists of order number and line number, examine both together. Where many exports do not provide a stable identifier, document a conservative comparison and send doubtful rows for review instead of discarding them. A row can look similar because two people ordered the same thing.

Mark candidate duplicates first. Excel can show duplicates with conditional formatting, while the Remove Duplicates command can discard records based on selected columns. Power Query can keep or remove duplicates based on the comparison columns. In either workflow, make the choice visible. Selecting the wrong set of columns merely produces a more orderly error.

Normalize what can be stated clearly

Remove incidental spaces from fields where spaces have no business meaning, such as a country code. For names, inspect the problem first and preserve punctuation and meaningful spaces. Standardize valid choices by mapping them to a short review table. If a field contains “United Kingdom,” “UK,” and “U.K.,” record their equivalence explicitly so a colleague can update the rule. Leave an unfamiliar abbreviation visible for a person to interpret.

Dates deserve a separate pass. A value like 05/06/2026 can mean May 6 or June 5 depending on the source. Find out which system produced the export and whether it consistently uses one convention. If a particular column mixes formats, avoid blanket conversion until you can distinguish them. Keep the original value and attach a flag to the row if you cannot decide what it means.

Separate blanks, zeroes, and strings written as “N/A.” A blank shipping date might mean an order is open. A discount of zero may be an explicit statement that no discount applied. A missing value could reflect an export error. A tidy report can show all three situations consistently while still preserving their separate meanings.

Reconcile the result with something you trust

Count accepted and flagged rows and compare their sum with the expected working source count. If you intentionally remove repeats or subtotals, record their count separately. Look at totals before and after for amounts whose units are the same. If the original combines currencies, check each currency on its own. A global total combining dollars and pounds is not a useful reconciliation.

Select a few records from the raw file and locate them in the result. Choose inconvenient examples as well as ordinary ones. A refund, an order with several lines, and a customer with a name used twice are better checks than three consecutive sales with a single item each. Choose some from the cleaned output and trace them back in the other direction.

Suppose there were 640 source lines. The output contains 628 accepted lines, plus five rows with unclear dates. You can account for seven lines by showing that three were headers and four were repeated export records under a documented rule. The person reviewing the report can now question the rule instead of searching hundreds of rows for missing data.

Repeat next month without rebuilding the logic

When the file arrives regularly, try a refreshable import or keep a compact checklist beside the spreadsheet. Include the file's expected column names, format, source, and a clear place for exceptions. Stop or flag changes when a required column disappears. A successful refresh can still produce the wrong result if a source application has renamed an important field and your logic quietly uses something else.

Keep working notes small enough that people will use them. A short note beside a formula explaining why leading zeroes are preserved is worth more than a long guide in an unrelated folder. Save output with a version or date and avoid distributing copies of the raw file if they contain email addresses or information recipients do not need.

The following month, test the cleanup with a copy of the last known good export, then with the new file. Compare counts, inspect flagged records, and review any new values in the mapping table. You will spend the time on decisions a human has to make. The work of stripping spaces, checking duplicates, and producing the same column order can repeat exactly.

Let ambiguous rows travel with the report

Create a review tab that keeps one record per issue and includes its original line reference. Give an issue a clear reason such as “source date convention is unknown” or “two prices found for order 3719.” Keep enough surrounding information for a reviewer to answer it. If the question can only be resolved by someone in another department, write the field that person needs to confirm, without sharing unnecessary personal information.

Decide whether a report can be issued with particular rows unresolved. A daily volume chart may tolerate an unknown customer category if the volume still counts. A report that sends booking reminders can rarely tolerate an uncertain date. Add the accepted rule to the report notes. When a decision is made, preserve what the source originally said and the reason for the change. A correction table that matches the original row key can store that history without altering the raw file.

Keep query changes small enough to check

For a recurring import, apply one transformation at a time and give steps plain names. Combine a date conversion and a currency transformation only if they depend on one another. An obvious series of named steps lets you locate the first point where the result differs from the export. Inspect transformations that convert errors to blanks. If errors actually represent source defects, hiding them turns a problem with evidence into a problem without evidence.

Run the process again after fixing a mapping rule and verify that the same raw file and rule produce the same result. Export a human-readable copy for recipients who only need the report. Keep formulas, query definitions, and separate working notes available to the people responsible for future changes. The handoff should tell them where to put the next source file and what to inspect before distributing the output.

Watch for an edge case in a real export

Suppose a swapped spreadsheet has an order total in every line of a multi-item order. Adding the amount column will overstate sales before you have even cleaned the file. Check the scope of each numeric field against what a row represents. You may need to aggregate by order first, or use a line amount supplied by the original system. Preserve the separate fields until your totals reconcile against a trusted statement.

Another common situation is a monthly extract with an item that appears outside its expected period because it was returned or corrected later. The posted date and the original order date may both matter. Ask which date the report needs and label that choice explicitly. Correct rows should survive cleaning even when they look unusual. The finished process gives someone a route from the summary all the way back to those decisions.

Reference

Microsoft Support, Find and remove duplicates in Excel and Keep or remove duplicate rows in Power Query.