Clean and reshape imported spreadsheet data
8 steps · about 1 h 33 min · Intermediate
- Recognise a tidy table (article, Wikipedia, 12 min)
Start with a clear target: one variable per column, one observation per row and one value per cell.
- Inspect delimiters before importing (article, Wikipedia, 10 min)
Recognise separators, quoting and encoding choices before a malformed import spreads across the workbook.
- Assign deliberate data types (article, Wikipedia, 12 min)
Distinguish text, numbers, dates and logical values so sorting and formulas behave predictably.
- Remove invisible spacing problems (article, Wikipedia, 8 min)
Find leading, trailing and non-breaking spaces that make apparently equal labels compare differently.
- Split patterned text carefully (article, Wikipedia, 15 min)
Use repeatable patterns to separate codes and labels while retaining the original column for comparison.
- Match related records conservatively (article, Wikipedia, 14 min)
Understand why near-matching names need explicit rules and review instead of an aggressive automatic merge.
- Remove true duplicates (article, Wikipedia, 10 min)
Choose a defensible key, inspect collisions and remove only rows that represent the same record.
- Validate and document the clean table (article, Wikipedia, 12 min)
Check completeness, consistency and plausible ranges, then record transformations so the result can be reproduced.