Cleaning data: turning messy into reliable
Raw data is always messy, and dirty data produces confident, wrong answers, the most dangerous kind, because they get believed. Cleaning is unglamorous but it is where trustworthy analysis is actually built. Let us look at what "dirty" means and how to fix it.
The common problems, with examples
Look at this messy little table and spot the issues:
| customer | region | amount | date |
|---|---|---|---|
| Maria | US | 200 | 2026-03-01 |
| Maria | US | 200 | 2026-03-01 |
| John | U.S. | 1500 | 01/03/2026 |
| Sara | UK | 2026-03-02 |
Four classic problems are hiding here. Duplicates: Maria's row appears twice, which would double-count her 200. Inconsistent categories: "US" and "U.S." are the same region typed differently, so a regional total would split them wrongly. Inconsistent date formats: one date is "2026-03-01" and another is "01/03/2026", which tools may misread. Missing values: Sara's amount is blank, which will break a sum or be treated as zero.
How to fix each
De-duplicate by removing exact repeated rows. Standardise categories so every variant of "US" becomes one value. Convert all dates to a single consistent format (the international YYYY-MM-DD is safest). Decide deliberately what to do with missing values: fill them with a sensible value, exclude those rows, or flag them, but never silently ignore them. And crucially, document every change so your work is reproducible and trusted.
The traps that bite hardest in finance
Two finance-specific problems produce no error message yet ruin the answer. Currency mixing: adding dollars, pounds and euros into one total as if they were the same. Period mismatches: blending calendar months with fiscal months, or weekly with monthly data. Always normalise currencies and time periods before analysing.
The golden rule of cleaning
Validate before you trust, every time, no matter where the data came from. "It came from the system" is not a guarantee of cleanliness; systems export duplicates and errors constantly. A quick sanity check, do the totals make sense, do the counts match, is any number absurdly large, catches most disasters.
- Dirty data produces confident, wrong answers.
- Fix duplicates, inconsistent categories, date formats, and missing values.
- Normalise currencies and periods; they silently corrupt finance data.
- Validate before you trust, and document every change.