Ravindra BagaleCourses & study guides Track your progress

Excel CLEAN Function

Chala mitrano — cLEAN sweeps invisible junk characters that TRIM cannot see. Use it after old-system imports.

Fictional sample data for learning. Imports from old systems (Jalgaon co-op bank files + New York mainframe extracts). Mixed ₹ and $.

Purpose

Remove non-printable characters from text (the invisible control characters that break lookups).

Return value

Text without non-printable characters.

Syntax

CLEAN(text)

Arguments

ArgumentRequired?Description
textRequiredThe text that may contain non-printable characters.

Version

All Excel versions. LibreOffice Calc compatible.

How to use — Why → What → How

Why: Jalgaon co-op bank files still arrive with CHAR(7) and CHAR(9) junk from old software. New York extracts do the same. Lookups fail until CLEAN runs. CLEAN belongs in the import ritual with TRIM. Show LEN dropping after CLEAN on a CHAR(7) demo. Remind that CHAR(160) survives CLEAN.

What: CLEAN removes characters with codes 0–31. It does not remove non-breaking spaces (160) — use SUBSTITUTE for those. Pair with TRIM. Read every argument in the table once before you type; each one changes the answer on purpose.

How — numbered steps:

  1. Type =CLEAN(A2).
  2. Wrap TRIM: =TRIM(CLEAN(A2)).
  3. Fill down.
  4. Compare LEN before and after.
  5. Paste values when clean.

Ravindra Bagale's Tip

Friends, cLEAN then TRIM is the classic one-two after a mainframe or PDF-to-Excel paste.

Ravindra Bagale's Tip

Friends, sleep on CLEAN and rebuild example 1 tomorrow without looking. That five-minute test beats rereading the whole page.

Ravindra Bagale's Tip

Friends, after you finish CLEAN, open yesterday’s real workbook and find one place this function would have saved ten minutes. That habit turns lessons into salary skills.

Download practice file: practice-clean.xlsx (includes sheet About this data, practice sheets, and Answers).

Worked examples

1) Remove CHAR(7)

Jalgaon import. Build junk with CHAR then CLEAN.

Formula demo
See formula →
Formula: =CLEAN("Pune"&CHAR(7)&"City")

Result: PuneCity

What it means: Bell character removed (words may stick — add space logic if needed).

2) CLEAN+TRIM

NY extract with tab.

Formula demo
See formula →
Formula: =TRIM(CLEAN(" Hello"&CHAR(9)&" "))

Result: Hello

What it means: Tab cleaned, spaces trimmed.

3) Already clean

Normal text.

City
Mumbai
Formula: =CLEAN(A2)

Result: Mumbai

What it means: No change.

4) LEN proof

Before/after length.

Formula demo
See formula →
Formula: =LEN("Hi"&CHAR(7))&"→"&LEN(CLEAN("Hi"&CHAR(7)))

Result: 3→2

What it means: Length drops after CLEAN.

5) Nested with UPPER

Clean then case.

Formula demo
See formula →
Formula: =UPPER(CLEAN("mh"&CHAR(7)))

Result: MH

What it means: Clean first.

6) CHAR(160) still there

Needs SUBSTITUTE.

Name
Neha Shah
Formula: =CLEAN(A2)

Result: Neha Shah

What it means: CLEAN does not remove CHAR(160).

About this data. Small demo rows for learning. Real sheets are longer; the same formula pattern scales when columns are clean.

Common errors and fixes

Still looks dirty — CHAR(160) or odd Unicode. Fix: SUBSTITUTE non-breaking spaces; consider Power Query.
Words stuck together — Removed char was a separator. Fix: Replace specific CHAR codes with a space first.

Notes and tips

  • CLEAN targets codes 0–31.
  • Always consider TRIM(CLEAN()).
  • CHAR(160) needs SUBSTITUTE.
  • Legacy banking files in Maharashtra and mainframe dumps in New York still ship control characters. Teach CLEAN as part of the import ritual.
  • CLEAN vs TRIM: invisible controls vs spaces. CLEAN vs SUBSTITUTE: SUBSTITUTE can target CHAR(160).
  • Fictional sample data only — practice amounts and names are made for learning.
  • After the 10 tasks, re-read the errors table once.
  • Say the business question in plain words before you type equals.
  • Keep a scrap sheet for experiments so you do not overwrite class files.
  • Fill formulas down only after the first row looks correct.
  • When two answers look possible, write both on paper then test in Excel.
  • CLEAN belongs in the import ritual with TRIM. Show LEN dropping after CLEAN on a CHAR(7) demo. Remind that CHAR(160) survives CLEAN.
  • Revisit the CLEAN errors table after the quiz — most classroom mistakes are listed there.
  • Build one brand-new example on a blank sheet from memory before you close the laptop.
  • If a result looks wrong, check spaces with LEN and case with exact equals before changing the formula.
  • Share one tip from this page with a classmate in Marathi or Hindi — teaching locks the idea.
  • Keep currency symbols consistent inside a single report column even when practice mixes ₹ $ £ € across examples.
  • When Excel versions differ at home and in class, write the fallback formula under the modern one in a comment cell.
  • Print the revision card for CLEAN and stick it near your monitor for one week of real worksheets.
  • When helping a junior, ask them to predict the result before pressing Enter — prediction builds judgement.
  • Keep a personal notebook of the one mistake you make most often with this function; review it monthly.

In real work

Legacy banking files in Maharashtra and mainframe dumps in New York still ship control characters. Teach CLEAN as part of the import ritual. CLEAN belongs in the import ritual with TRIM. Show LEN dropping after CLEAN on a CHAR(7) demo. Remind that CHAR(160) survives CLEAN. Classroom drill: write three brand-new CLEAN formulas on a blank sheet using names from your own city — if you can invent them without the page open, you own the skill. Then break one formula on purpose (wrong case, wrong start, extra space) and watch the error; recovering from that break is half of interview readiness.

How it compares

CLEAN vs TRIM: invisible controls vs spaces. CLEAN vs SUBSTITUTE: SUBSTITUTE can target CHAR(160).

Interview corner

What does CLEAN remove?
Non-printables 0–31.
CHAR(160)?
SUBSTITUTE.
Typical pair?
TRIM(CLEAN()).

TRIM, SUBSTITUTE, CODE

Practice tasks (10)

  1. Task 1. CLEAN a cell with CHAR(7).
    Hint: build with CHAR.
  2. Task 2. TRIM(CLEAN()) combo.
    Hint: nest.
  3. Task 3. LEN before/after.
    Hint: two formulas.
  4. Task 4. Show CLEAN leaves CHAR(160).
    Hint: example 6.
  5. Task 5. UPPER(CLEAN()) on mh+junk.
    Hint: nest.
  6. Task 6. Fill for three import rows.
    Hint: fill down.
  7. Task 7. Note when words stick.
    Hint: separator lost.
  8. Task 8. Paste values after clean.
    Hint: Paste Special.
  9. Task 9. Compare CLEAN vs TRIM in a sentence.
    Hint: controls vs spaces.
  10. Task 10. Interview: codes 0–31?
    Hint: yes.

Quick quiz

Q1. CLEAN removes:
Q2. CHAR(160) needs:
Q3. Classic pair:
Q4. Returns:
Q5. Use after:

Answers: Q1=Non-printables 0–31, Q2=SUBSTITUTE, Q3=TRIM(CLEAN()), Q4=Text, Q5=Old-system imports (check after you try).

Revision card

Standalone card (no tip or photo strip). QR opens this lesson. Download the PNG and revise offline.

Revision card: CLEAN
CLEAN revision card