A repeatable process for turning any messy export into an analysis-ready table. Run it
top to bottom every time and you'll never again wonder "did I forget something?" The steps
map directly onto the tabs in this workbook; worked numbers match the sample data.
Golden rule: never clean in place. Keep the raw export on its own tab (`01-Dirty
Data`) and build everything else from it. If a step goes wrong, you can always start over
from the original.
Spend two minutes seeing what you're dealing with before changing anything.
=ROWS(A:A) and eyeball the headers.=UNIQUE(E2:E23) shows every spelling ofCountry at once โ the fastest way to spot USA / U.S.A. / Unites States.
=COUNTBLANK(C2:C23).This tells you which of the steps below you actually need.
Leading, trailing, and double spaces are the most common (and most invisible) defect. TRIM
fixes all three.
=TRIM(B2)
" john SMITH " โ john SMITH; "Aisha Khan" โ Aisha Khan. Test it with
=EXACT(B2, TRIM(B2)) โ any FALSE had hidden spaces.
Pick one convention per column. Names โ PROPER; emails and codes โ LOWER; country/state
abbreviations โ UPPER.
=PROPER(TRIM(B2)) =LOWER(TRIM(C2)) =UPPER(TRIM(StateCode))
Watch the PROPER edge cases (McDonald, iPhone, O'Connor is fine) and fix the few
exceptions by hand.
Make every value in a column look identical:
(555) 207-3322.=TEXT(DATEVALUE(F2), "yyyy-mm-dd") collapses four input formats into one.=VALUE(SUBSTITUTE(SUBSTITUTE(G2,"$",""),",","")) turns "$3,450.50" intoa real number 3450.5.
A column you can't SUM or SORT correctly isn't clean yet.
Map every variant to one canonical value using the Normalization Map and XLOOKUP. After
this step, COUNTIF(Country, "United States") returns the true count instead of being split
across eight spellings.
One value per cell. Split Full_Name into first/last with SPLIT/TEXTSPLIT if you need to
sort by surname; combine City + State only for display, never for storage.
Decide per column โ don't leave it to chance:
"Unknown" / "N/A" so blanks don'tmasquerade as zero. =IF(TRIM(H2)="", "Unknown", H2).
AVERAGE), *not* 0.Numbers stored as text are the classic silent bug (they left-align and break SUM). Force
the type: =VALUE(text) for numbers, =DATEVALUE(text) for dates. Confirm with =ISNUMBER.
Apply the checks from 04-Validation Rules as columns. A master flag โ
=IF(COUNTIF(RuleCols, FALSE)=0, "OK", "Needs review") โ turns the sheet into a self-audit.
Fix or quarantine every Needs review row before moving on.
Only now, with formats normalized, is your match key reliable. Build it, flag duplicates with
the running COUNTIF, and filter to Keep. In the sample this drops records 19โ22 and
leaves 18 unique customers.
Order matters: clean before you dedup.
"[email protected] "and
"[email protected]"only collapse into one once Steps 1โ2 have run.
Run the descriptive statistics. An IQR fence test (Q1 โ 1.5ยทIQR, Q3 + 1.5ยทIQR) flags
values that deserve a second look. In the sample it catches ORD-1031 at $20,000. An outlier
isn't automatically wrong โ it might be a real whale of a deal โ but every one earns a
"is this right?" check before you report an average.
Reconcile. Does the cleaned row count make sense (22 raw โ 4 dupes = 18)? Does the pivot
grand total equal the sum of the source rows ($87,449.00 both ways)? Does spend per
customer look plausible? A number that doesn't tie out is a bug, not a feature.
README cell or tab โ future-you willthank you.
fast.
| # | Step | Tool |
|---|---|---|
| 1 | Trim whitespace | TRIM |
| 2 | Fix case | PROPER / LOWER / UPPER |
| 3 | Standardize formats | phone/date/currency formulas |
| 4 | Normalize categories | XLOOKUP + map |
| 5 | Split / combine fields | SPLIT / & |
| 6 | Handle blanks | IF(...="", ...) |
| 7 | Fix data types | VALUE / DATEVALUE |
| 8 | Validate | rule columns + master flag |
| 9 | Deduplicate | match key + COUNTIF / UNIQUE |
| 10 | Find outliers | QUARTILE + IQR fences |
| 11 | Reconcile totals | SUM cross-checks |
| 12 | Document & freeze | Paste Special โ Values |
Pin this list next to your monitor. Cleaning data well is not about cleverness โ it's about
running the same boring checklist every single time.
Questions about applying this to your data? Email [email protected].
Get the full Data Cleaning & Analysis Templates and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.