Wauvel
Toolkit

Cleaning messy data in Excel: the six functions that do it

← All posts
By Blake EkelundJuly 3, 2026 · 8 min read

Every useful spreadsheet starts with an ugly one. You export a customer list, a transaction dump, a payroll file — and it arrives with names typed three different ways, a whole address crammed into one cell, trailing spaces you can't even see, and dollar amounts that Excel insists are text. Before you can total it, chart it, or look anything up in it, you have to normalize it: make the values consistent so identical things actually read as identical.

It sounds like drudgery, and done by hand it is. But normalizing data is really just five or six recurring problems, and Excel has a function for each — most of them a single formula you fill down a column. Here are the six a finance operator reaches for most, in the order you usually need them.

1. Strip the invisible junk first — TRIM and CLEAN

Start here, always, because the most damaging mess is the kind you can't see. A value pasted out of a PDF, an email, or a web page almost always carries leading spaces, trailing spaces, or double spaces between words. They're invisible on screen and catastrophic underneath: "Acme " and "Acme" are different customers to Excel, so a lookup misses, a unique list shows the same name twice, and a SUMIFS quietly under-totals.

TRIM fixes it in one move: it removes spaces from the ends and collapses any run of spaces between words down to a single one. Its partner CLEAN strips non-printing characters — the stray line breaks and control codes that ride along with a paste — so =TRIM(CLEAN(A2)) is the belt-and-suspenders cleanup for anything you didn't type yourself.

TRIM
B2=TRIM(A2)
AB
1RawCleaned
2 Acme Co Acme Co
3Length11 → 7
Same-looking name, different underlying text. TRIM makes them match — which is what lets the lookup, the SUMIFS, and the de-dupe finally agree. The LEN counts prove characters were actually removed, not just hidden.
One gotcha: text copied from the web often contains non-breaking spaces (character 160), which TRIM won't touch. For those, convert them first: =TRIM(SUBSTITUTE(A2, CHAR(160), " ")) — which is a nice segue to function number five.

2. Make the casing consistent — PROPER, UPPER, LOWER

A name column filled in by ten different people is a mess of jane doe, JANE DOE, and Jane DOE. None of it is wrong, exactly, but it looks unintentional and it groups badly. PROPER capitalizes the first letter of every word and lower-cases the rest, so the whole column reads as one clean Jane Doe. Its siblings UPPER and LOWER force everything to one case — UPPER for state or currency codes, LOWER for emails so they match no matter how they were typed.

PROPER isn't clever about names — it'll render McDonald as Mcdonald and LLC as Llc — so eyeball the proper nouns and acronyms after, and patch the exceptions with SUBSTITUTE. It's a normalizer, not a proofreader.

3. Split one crammed cell into many — TEXTSPLIT

The classic import problem: a whole address — 123 Main St, Austin, TX — sitting in a single cell, when you need street, city, and state in three columns you can filter and group by. The old fix was the Text-to-Columns wizard, which you had to re-run by hand every time the data changed.

TEXTSPLIT does it as a live formula instead. Give it the delimiter — here the comma-space — and it breaks the string into pieces that spill across the columns to the right, and re-splits itself the moment the source cell changes. One delimiter splits into columns; a second, optional one starts new rows, so you can unpack a whole pasted block at once.

TEXTSPLIT
B2=TEXTSPLIT(A2, ", ")
ABCD
1AddressStreetCityState
2123 Main St, Austin, TX123 Main StAustinTX
One messy cell becomes three clean ones with a single formula that updates itself. Microsoft 365 / Excel 2021+. On older Excel, Data → Text to Columns does the same as a one-off.

Free · no account · no card

Get your 2027 budget built from your QuickBooks — P&L, balance sheet and cash flow, in Excel.

Build my 2027 budget →

4. Pull out just the piece you need — TEXTBEFORE and TEXTAFTER

Sometimes you don't want to split everything — you want one specific part. The first name off a First Last column. The domain of an email. The account code before a dash. That's the job of the matched pair TEXTBEFORE and TEXTAFTER: name a marker and they hand back everything on one side of it.

  • =TEXTBEFORE(A2, " ") → the first name (everything before the first space).
  • =TEXTAFTER(A2, " ") → the last name (everything after it). Use TEXTAFTER(A2, " ", -1) to start after the last space, so it survives middle names.
  • =TEXTAFTER(A2, "@") → the email domain, for grouping personal addresses apart from company ones.

They replace the old LEFT(A2, FIND(" ", A2) - 1) contortion that everyone had to look up every time — and they take a built-in fallback for when the marker isn't there, so a stray one-word entry returns your default instead of a #N/A that spreads down the column.

5. Standardize values and strip symbols — SUBSTITUTE

The last recurring mess is inconsistent values: St in one row and Street in the next, or amounts pasted as text — $1,234 — that won't add up because the $ and the comma make Excel treat them as words. SUBSTITUTE is find-and-replace you can run inside a formula, without touching the source data: it swaps every occurrence of one piece of text for another.

Use =SUBSTITUTE(A2, "St", "Street") to standardize abbreviations, and nest it to strip characters: =VALUE(SUBSTITUTE(SUBSTITUTE(A2, "$", ""), ",", "")) peels off the dollar sign and the comma, then VALUE turns the leftover text into a real number you can finally total. (One warning: SUBSTITUTE matches text anywhere, so a bare "St" also hits the St inside "Street" — include the surrounding spaces, or target a single occurrence, when that's a risk.)

6. Then it all lines up

The reason to bother with any of this shows up the moment you're done. Once a key column is trimmed, cased, and standardized, everything downstream that depends on values matching suddenly works: XLOOKUP finds its match, SUMIFS totals the right rows, and UNIQUE returns a genuinely distinct list instead of near-duplicates. Ninety percent of "the lookup is broken" is really "the data wasn't normalized first."

A practical way to work: do the cleanup in helper columns with these formulas, check it looks right, then copy and Paste Values over the original so the cleaned text is real, not formula output that breaks if you delete the source. It's the same discipline behind every tidy model — and it's the unglamorous first step of the afternoon in the case of the missing cash, where clean data was what let the real analysis begin.

Each of these has its own page in the Wauvel Excel reference — with a live demo you can type into and a branded Excel file to download and keep. And when it's your own books that need reading, not just cleaning, Wauvel turns a month of statements into a plain-English report. See how it works →

Need your financials for a lender, a buyer or your accountant? Get the free financials pack →

See what an AI CFO says about your own numbers.

$99/mo, everything included. Free for 14 days, no card.

Meet your AI CFO →

Keep reading

ToolkitOctober 5, 2026 · 6 min read

The 13-week cash flow, rebuilt every Monday

Most cash forecasts are built once, admired, and never opened again. The value isn't in the model - it's in the twenty-minute weekly habit of rolling it forward and comparing what you predicted to what happened.

Read it →
ToolkitSeptember 27, 2026 · 8 min read

How to build a small business pro forma a lender will believe

A bank, a landlord, or a seller asks for a pro forma and most owners start from a blank spreadsheet. Start from your last twelve months instead, add the one change you're asking about, and check the number the lender will check first.

Read it →
ToolkitSeptember 9, 2026 · 7 min read

The month-end close that takes four hours, not four days

A slow close is almost never a bookkeeping speed problem - it's a sequencing problem. Here's the order that removes the waiting, the four reconciliations that catch nearly every error, and the rule that decides when the month is actually done.

Read it →
ToolkitSeptember 7, 2026 · 8 min read

Building next year's operating plan (start now, not in December)

An annual plan built in the last week of December is a wish list. Built in September, it is a decision you have time to act on. Here's the order to build one in, how long each layer takes, and the difference between a plan and a forecast.

Read it →
ToolkitSeptember 3, 2026 · 7 min read

The 10 KPIs worth watching weekly (and the 40 that aren't)

Most dashboards fail because they show everything, which is the same as showing nothing. Here are the ten numbers that earn a weekly look for a small business, why each one is on the list, and the test for whether a metric deserves your attention at all.

Read it →
ToolkitAugust 24, 2026 · 7 min read

Recurring, capacity, or funnel: which revenue engine are you?

Almost every business makes money in one of three shapes, and the shape determines which numbers you should be forecasting. Pick yours and you stop guessing at revenue - you start building it from drivers you can actually influence.

Read it →
ToolkitJuly 7, 2026 · 8 min read

SUMIFS: turn a raw QuickBooks export into a P&L with one formula

Export your general ledger and you get a flat list of every transaction — not a report. SUMIFS is the one formula that rolls that list up into a P&L: revenue by month, opex by category, all of it. Here's exactly how, plus the traps that quietly return a wrong number.

Read it →
ToolkitJuly 1, 2026 · 7 min read

XLOOKUP vs VLOOKUP vs INDEX/MATCH: which lookup should you use?

The one-line answer is XLOOKUP — but VLOOKUP and INDEX/MATCH still earn their keep, and INDEX MATCH MATCH does something none of the others can. Here's each one, side by side, with the exact moment you'd reach for it.

Read it →
ToolkitJune 26, 2026 · 9 min read

The case of the missing cash: a CFO's afternoon in Excel

A wholesale distributor turns a profit every month and still can't make its credit line breathe. Here's the afternoon a fractional CFO spent cracking it — and the dozen Excel formulas she reached for, what each one does, and exactly when you'd use it.

Read it →