Excel Data Cleaning
From spreadsheet garbage to analysis-ready
Spreadsheets arrive messy: spaces, mixed types, duplicates, inconsistent casing and broken dates. A set of core functions and checks turns that into analysis-ready tables.
What you will learn
- Normalize text, numbers and dates with core functions
- Find and remove duplicates safely
- Validate entries at entry time with data validation
What is this?
Excel data cleaning is applying a repeatable set of transformations: TRIM/SUBSTITUTE for text, ISNUMBER/VALUE for type forcing, TEXT/date functions for dates, Remove Duplicates, and Data Validation to prevent recontamination. The goal is one clean, type-consistent table that downstream pivots and lookups can trust.
Why do you need it?
- Most analyzes fail at the trust layer, not the math: a stray space breaks a lookup.
- Duplicate rows silently double counts in aggregates.
- Text dates and numbers-as-text block grouping, sorting and joining.
- Cleaning steps recorded in Power Query become a reusable pipeline.
Mental model
Washing and sorting produce before cooking
Cleaning spreadsheet data
You don't cook dirty, mixed, same-looking crates. You wash (types), sort (dedupe), and trim before the dish — the recipe stays the same, the ingredients just behave.
How it works
- TRIM() removes extra spaces; CLEAN() strips control characters; SUBSTITUTE() replaces tokens.
- VALUE()/-- coerces numbers stored as text; TEXT()/formatting displays dates properly.
- Remove Duplicates uses the selected columns to collapse exact-match repeat rows.
- Data Validation drops a whitelist (List) or rules on a column so bad entries are rejected at entry.
- Conditional formatting highlights blanks, negatives and anomalies for review before you commit.
The cleaning pass order.
Examples
A standard normalization recipe
// Text hygiene=TRIM(CLEAN(A2))=UPPER(N3) / =PROPER(N3) // casing control=SUBSTITUTE(A2, "USD", "") // token removal // Type forcing=VALUE(A2) // text-number to real number=ISNUMBER(A2) // detect non-numeric values=TEXT(D2, "yyyy-mm-dd") // canonical date string // Blanks + duplicates=COUNTIF(A$2:A$100, A2) // flag repeat keys=IF(COUNTIF(B$2:B$100, B2)>1,"DUP","OK")This chain normalizes text noise, coerces types and flags duplicates before any aggregation touches the data.
In production
- A monthly member export gets TRIMmed, deduped on member ID, then pivoted — without touching the source export.
- Amounts imported as text from a legacy system get =-- coercion so SUM works.
- An entry form enforces Data Validation lists so operators can't enter nonstandard region codes.
Best practices
- Never clean in place: work on a transform column or a copy so you can trace every change.
- Audit first: freeze a snapshot of counts (rows, blanks, dups) before and after cleaning.
- Standardize casing and date format to one convention across the workbook.
- Move repeatable cleaning into Power Query so it replays on the next export.
Common mistakes
- Removing duplicates on ALL columns when identity is one key — destroys legitimate repeat records.
- Cleaning in place then losing the ability to explain the change to reviewers.
- Coercing 'N/A' text with VALUE() producing #VALUE! that then spreads.
- Not validating at entry, so the same mess returns next week.
Debugging tips
- A lookup returns #N/A though values look identical — check TRIM and number-vs-text now.
- SUM ignores part of a column — those cells are text; convert with VALUE.
- Grouping by month fails — the 'date' is text; convert with DATEVALUE or TEXT.
- Count duplicates with COUNTIF on the identity key before trusting Dedupe.
Interview checkpoint
Quick quiz
Which function removes accidental leading/trailing spaces?
Removing duplicates on every column is usually correct.