Work in this order: trim whitespace, fix data types, remove blank rows and columns, then remove duplicates last. Duplicate detection compares values exactly, so “Acme Ltd” and “Acme Ltd ” are different rows until the whitespace is trimmed — cleaning in the wrong order leaves duplicates behind and looks like it worked.
A spreadsheet that has passed through several people acquires a particular kind of mess: stray blank rows, a heading repeated halfway down, numbers stored as text, dates in three formats, and duplicates that are not quite identical. None of it is hard to fix. Fixing it in the wrong order is what wastes the afternoon.
Do it in this order
The steps interact, and one ordering is clearly correct.
Trim whitespace from every cell.
Normalise data types — numbers as numbers, dates as dates.
Remove blank rows and columns.
Remove duplicates.
Check the result against the original row count.
Duplicates come last because duplicate detection compares values, and values that have not been cleaned do not match. Whitespace comes first because everything downstream depends on it.
Whitespace, and why it defeats everything
A trailing space is invisible. It survives copying, it survives export, and it is the single most common reason a cleaning pass appears to work while achieving nothing.
To a computer, “Acme Ltd” and “Acme Ltd ” are two different strings. Deduplication keeps both. A lookup against one fails to find the other. A grouped total splits across two categories that read identically on screen. You can stare directly at the problem and not see it.
A column is either numeric or it is not, and a single cell breaks the distinction. One entry reading “12 units”, or “N/A”, or a number with a stray apostrophe in front of it, and the whole column becomes text.
The consequences are quiet. Sums skip the text cells rather than failing. Sorting puts 100 before 20, because as text it does. Charts drop the values they cannot read. Nothing reports an error, and the numbers are simply wrong.
Running data type detection across the sheet tells you which columns are mixed, which is much faster than scrolling to find the one cell responsible. Column statistics then confirms the fix — if the count of numeric values matches the row count, the column is clean.
Blank rows and columns
Empty rows break more than they look like they should. Many operations treat a blank row as the end of the data, so a sort or a filter silently applies to the top section only and leaves the rest untouched and unsorted.
Empty columns cause the same trouble sideways, and both tend to arrive from exports that padded the sheet out to a fixed size.
Two cases need care before removing them. A row that is blank apart from a stray space is not blank — trim first, which is why trimming leads. And a row deliberately left empty as a visual separator between sections carries meaning that will be lost; a spreadsheet laid out for reading rather than for processing may need restructuring instead of cleaning.
Duplicates are a judgement, not a fact
The word “duplicate” hides a decision: duplicate according to which columns?
Two orders from the same customer on the same day for the same amount are duplicates if the file was imported twice, and two genuine orders if it was not. Nothing in the data can tell you which. Whole-row matching is the safe default because it only removes rows that are identical in every respect, but it will keep near-duplicates that differ by one typo.
Matching on a key column — an ID, an email address — catches more, and will delete rows that differ elsewhere in ways you may have wanted to keep. Decide which you mean before removing anything, and keep the original file either way.
Check the result
Cleaning is destructive, and the failure mode is deleting rows you needed rather than leaving rows you did not. Two checks catch nearly everything.
Compare row counts before and after. If 4,000 rows became 1,200, the duplicate rule was broader than you intended and it is worth understanding why before continuing.
Total a numeric column before and after. Removing duplicates should reduce it by roughly the proportion of rows removed; a total that barely moves means the removed rows were not the ones you thought.
Why to clean it on your own machine
Spreadsheets needing a clean-up are usually the ones full of real records — customers, employees, transactions, contact details. It is the least anonymous file most people handle, and cleaning it is the moment it gets uploaded to whichever free tool came up first.
None of this work requires a server. Trimming, type checking, and comparing rows are operations a browser performs immediately on a file it never sends anywhere, which keeps a list of real people out of a third party’s logs for no loss in capability.