🎓 Zero-to-Hero masterclass

Data Cleaning

Wash and chop your data before you cook: rinse stray spaces, fix the CAPITALS, strip rupees and commas, and bin the duplicates.

10 functions3 power tools2 maps7 live drills
🟢 Foundation 🗺️ Visual map 🟡 Deep dive 🔴 Traps & hacks 💻 Sandbox
🟢

The Foundation

Level 1 · the hook & basics

Imagine you are about to cook a lovely meal. Before the fancy recipe begins you wash and chop the vegetables — you rinse off the grit, cut away the bad bits, and throw out anything rotten. Skip that step and the finest recipe in the world still tastes of mud. Data cleaning is exactly that washing-and-chopping stage, done to your spreadsheet before any analysis begins.

Why does it matter so much? Because Excel is fussy and literal. If one cell says "Mumbai " with a sneaky trailing space and the next says "Mumbai", Excel treats them as two different cities. A SUM quietly skips numbers that are secretly text. A VLOOKUP returns #N/A over an invisible space you cannot even see. Sorting jumbles up and totals come out wrong — the analysis is not broken, the ingredients were gritty.

Real Indian data arrives messy in very predictable ways:

  • Names typed with double  spaces or wandering CAPITALS, such as ravi  KUMAR.
  • Amounts pasted as text with rupee signs and commas, such as ₹1,20,000 — which simply will not add up.
  • Phone numbers and pincodes glued together with dashes, such as 98765-43210 and 110-001.
  • The same customer entered five times — rotten repeats that inflate every total.

The good news: the same handful of tools fix ninety per cent of it, and they fix a whole column in one go instead of retyping a thousand rows by hand. TRIM is your rinse under the tap — it washes off extra spaces. PROPER tidies the CAPITALS. SUBSTITUTE scrubs out unwanted characters. Remove Duplicates bins the rotten repeats. Build the habit of keeping your raw column untouched and growing the clean version in the next column, so you can always taste-test the before and after.

Golden habit: always TRIM before you match or join. Two cells that look identical can hide different spaces — clean first, compare second and your lookups stop failing.
🗺️

Visual Architecture

the whole system on one screen

Two pictures of the same job: first the whole cleaning kit at a glance, then a decision path for picking the right fix for a messy column.

🧠 The cleaning toolkitFour drawers, a few tools each

Data Cleaning

Spaces and case

TRIM

CLEAN

PROPER

Split apart

Text to Columns

Flash Fill

Dedupe

Remove Duplicates

COUNTIF

Fix numbers

SUBSTITUTE

VALUE

View Mermaid.js source
mindmap
  root((Data Cleaning))
    Spaces and case
      TRIM
      CLEAN
      PROPER
    Split apart
      Text to Columns
      Flash Fill
    Dedupe
      Remove Duplicates
      COUNTIF
    Fix numbers
      SUBSTITUTE
      VALUE
🧭 Which fix does this column needFollow the mess to its tool

Extra or double spaces

Wrong CAPITALS or case

Number stored as text

One field holds two things

Same row repeated

Look at the messy column

What is wrong with it

TRIM

PROPER

SUBSTITUTE then VALUE

Text to Columns or Flash Fill

Remove Duplicates

Clean column ready

View Mermaid.js source
flowchart TD
  A[Look at the messy column] --> B{What is wrong with it}
  B -->|Extra or double spaces| C[TRIM]
  B -->|Wrong CAPITALS or case| D[PROPER]
  B -->|Number stored as text| E[SUBSTITUTE then VALUE]
  B -->|One field holds two things| F[Text to Columns or Flash Fill]
  B -->|Same row repeated| G[Remove Duplicates]
  C --> H[Clean column ready]
  D --> H
  E --> H
  F --> H
  G --> H
🟡

The Deep Dive

Level 2–3 · core mechanics → expert edge

Good cleaning follows an order, like prepping vegetables in sequence: rinse, then chop, then bin the bad ones. Do it in the same order every time and messy data quietly becomes tidy data you can trust. Here is the same name before and after one quick pass.

The same name, before and after a quick clean BEFORE · gritty ··ravi···KUMAR·· stray spaces · shouting caps TRIM + PROPER AFTER · clean Ravi Kumar ready to sort, match and total

Now take the toolkit one drawer at a time, starting with the two invisible troublemakers: spaces and case.

Rinse the spaces — TRIM and CLEAN. TRIM(text) removes spaces from the start and end and squeezes any run of spaces inside down to a single one, so "  Ravi   Kumar  " becomes Ravi Kumar. It is the tool you will reach for most, because copied data is riddled with spaces you cannot see. Its partner CLEAN(text) strips non-printing characters — the invisible line breaks and control codes that ride in from websites and PDFs. Chain them for a deep rinse: =TRIM(CLEAN(A2)).

Fix the case — UPPER, LOWER, PROPER. UPPER shouts everything into CAPITALS (perfect for a PAN, or a vehicle number like MH12AB1234), LOWER drops it all to small letters (perfect for email addresses), and PROPER Capitalises The First Letter Of Each Word — the label-maker for names and cities. =PROPER("ravi KUMAR") gives Ravi Kumar.

ToolWhat it fixesExampleResult
TRIMstray and double spaces=TRIM(" ravi kumar ")ravi kumar
CLEANinvisible non-printing characters=CLEAN(A2)hidden junk gone
PROPERCapitalise Each Word=PROPER("ravi KUMAR")Ravi Kumar
UPPERALL CAPITALS=UPPER("mh12ab")MH12AB
SUBSTITUTEswap or delete characters=SUBSTITUTE("1,20,000",",","")120000
VALUEtext-number into a real number=VALUE("120000")120000
COUNTIFcount repeats to flag duplicates=COUNTIF(A2:A9,A2)3
IFERRORreplace an error with your own value=IFERROR(VALUE(A2),0)0

Split one column into many — Text to Columns and Flash Fill. When a single cell holds two facts — a full name, or Delhi-110001 — you must split it apart. The classic tool is the Text to Columns wizard.

Select the column of stuck-together data, for example a list of Ravi Kumar full names or Delhi-110001 city-pincodes.
Open the wizard from the ribbon: Data, then Text to Columns.
Pick how it splits. Choose Delimited when a character separates the parts (a space, comma or dash), or Fixed width when every part is the same length.
Tick the delimiter — Space for names, or type a dash under Other for Delhi-110001. Watch the live preview split into columns.
Set the destination to an empty column so you do not overwrite your raw data, then Finish. Ravi Kumar becomes Ravi and Kumar in two neat columns.

For quick, by-example splitting there is an even friendlier tool: Flash Fill. Type the answer you want in the next column — the first name only, or the pincode only — then press Ctrl+E. Excel studies your example, spots the pattern and fills the entire column in a blink. It is brilliant for reformatting phone numbers, pulling out initials, or reshaping dates by example, with no formula to write.

Bin the rotten repeats — Remove Duplicates and COUNTIF. Duplicate rows inflate every total and average. To delete them outright, select the range and use Data, then Remove Duplicates, ticking the columns that define a match. To find them first — far safer — add a helper column with =COUNTIF(A:A,A2)>1; any row marked TRUE is a repeat you can inspect before deleting. Seeing beats deleting blind.

Rescue numbers trapped as text — SUBSTITUTE and VALUE. Amounts like ₹1,20,000 often arrive as text and refuse to add up. Peel off the offending characters with SUBSTITUTE(text, old, new)=SUBSTITUTE("1,20,000",",","") deletes every comma — then wrap the result in VALUE to turn the digit-string into a real number: =VALUE(SUBSTITUTE(A2,",","")). The telltale sign a cell is text is the little green triangle in its corner and the number hugging the left edge.

Mind the blanks. A truly empty cell and a cell holding an invisible space are not the same thing — the second quietly breaks counts and filters. TRIM clears accidental spaces; for genuinely missing values decide on one rule (leave blank, or fill with 0 or NA) and apply it consistently, so COUNTA and your charts behave.

Neutralise errors — IFERROR. One bad cell can spray #VALUE! or #N/A across a whole column. Wrap a risky step so it fails softly: =IFERROR(VALUE(A2),0) hands back 0 (or any message you choose) instead of an ugly error, keeping the rest of your sheet calm.

Messy cellProblemFixClean result
Ravi Kumar stray and double spaces=TRIM(A2)Ravi Kumar
ravi KUMARwrong case=PROPER(A2)Ravi Kumar
₹1,20,000rupee and commas, stored as text=VALUE(SUBSTITUTE(SUBSTITUTE(A2,"₹",""),",",""))120000
98765-43210dash inside a phone number=SUBSTITUTE(A2,"-","")9876543210
Delhi-110001two fields in one cellText to ColumnsDelhi | 110001
The repeatable cleaning checklist — run it top to bottom on every new file:
  • Copy the sheet first — never clean your only copy.
  • TRIM and CLEAN the spaces.
  • Fix the case with PROPER, UPPER or LOWER.
  • Split stuck-together fields with Text to Columns or Flash Fill.
  • Strip ₹, commas and dashes, then VALUE the numbers.
  • COUNTIF to spot repeats, then Remove Duplicates.
  • Wrap risky steps in IFERROR.
Same order, every time.

The professional's tool — Power Query. For big files, or a clean-up you repeat every month, Excel hides a proper cleaning studio called Power Query (Get and Transform, on the Data ribbon). You perform each step once — trim, split, remove duplicates, change type — and Excel records them; next month you drop in the new file and re-run the whole recipe with a single click. Everything in this module is the hand tool; Power Query is the machine that does it for you.

🔴

Expert Traps & Hacks

Level 4 · where 90% slip — and the exam edge

Cleaning looks trivial, which is exactly why it bites. Here are the traps that quietly wreck real analysis, and the pro moves that dodge them.

Trap 1 — the number that will not add up (the green triangle). Paste ₹1,20,000 from a website or PDF and Excel stores it as text: it sits hugging the left edge of the cell and shows a small green triangle in the corner. SUM silently ignores it, so your total is wrong and nothing warns you loudly. Strip the rupee sign and commas with SUBSTITUTE, then convert with VALUE (or simply multiply by 1). For a quick one-off, click the green triangle and choose Convert to Number.
Trap 2 — the spaces TRIM cannot see. Data copied from the web often carries non-printing characters and non-breaking spaces that ordinary TRIM leaves behind. Reach for CLEAN to strip the invisible control characters — =TRIM(CLEAN(A2)) — and for a stubborn non-breaking space use =SUBSTITUTE(A2,CHAR(160)," ") before you TRIM.
Trap 3 — Remove Duplicates is permanent. It deletes rows in place and judges a duplicate only on the columns you tick. Tick just Name and two different people both called Ravi Kumar collapse into one. Always work on a copy, and SEE the repeats first with =COUNTIF(A:A,A2)>1 before you delete anything.
Trap 4 — cleaning on top of your only copy. Formulas clean into a new column; typing fixes straight over the raw data means one slip and the original is gone for good. Keep the raw column, build the clean one beside it, and only paste-as-values over the top once you have checked it.
Pro hack — the one-cell money cleaner. Turn messy rupee text into a real number in a single formula: =VALUE(SUBSTITUTE(SUBSTITUTE(A2,"₹",""),",","")). The inner SUBSTITUTE removes the ₹, the outer one removes the commas, and VALUE hands back 120000 ready to sum.
Pro hack — Flash Fill reads your mind (Ctrl+E). Type the finished result you want beside the first messy row — say Ravi next to Ravi Kumar — press Ctrl+E, and Excel spots the pattern and fills the whole column. No formula needed. Pair it with IFERROR to stop one stray bad row spilling #VALUE! across your sheet.
💻

Interactive Sandbox — Formula Sandbox

type a real formula — the cell fills and turns green

Seven messy cells from real Indian data. Type a formula, press Run, and the cell turns green the moment your text comes out clean.

🧮 Formula Sandboxtype it · run it · green when right
0Correct
0Streak
🇬🇧 The complete Excel pathThis module is one of ten. Work through them in order — Grid Basics to Dynamic Arrays — then keep the Function Atlas open as your desk reference. All 10 Excel modules →