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.

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 Lastcolumn. 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 UNIQUEreturns 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 Valuesover 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 →

See what a report like this looks like on your own numbers.

Get my free report →

Keep reading

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 →
ToolkitJune 26, 2026 · 9 min read

Financial modeling best practices: building a model that doesn't break

Models almost never fail on the math — they fail on structure, trust, and rot. Here are the practices CFOs use to build a model a banker (or your future self) can actually follow and believe.

Read it →
ProductJuly 9, 2026 · 5 min read

Alerts and Watch-outs: your 24/7 CFO

A real CFO doesn't wait for month-end. Two new features watch your live QuickBooks every day: Alerts ping you the moment a number you care about crosses a line, and Watch-outs quietly reviews your books for the mistakes that quietly break your reports.

Read it →
Finance 101July 7, 2026 · 9 min read

What's a healthy LTV:CAC ratio? (and how to find yours)

The number every founder spending on ads needs and the books won't give you: how much you can afford to pay for a customer. Here's how to calculate CAC and LTV honestly, what the 3:1 rule really means, why payback period bites harder than the ratio, and the ceiling you can bid to.

Read it →
ProductJuly 6, 2026 · 4 min read

Ask your finances a question — right in Slack

Type /wauvel and ask your AI CFO anything about your live QuickBooks numbers — cash, runway, top customers, a month's net income, even a hiring what-if — without leaving Slack. Plus daily digests and report pings in the same channel.

Read it →
ProductJuly 4, 2026 · 3 min read

Wauvel now posts your reports to Slack

Connect Slack once and your reports, daily digests, and cash alerts land in the channel your team already works in — not just your inbox. Read-only, one channel, disconnect anytime.

Read it →
Finance 101July 3, 2026 · 8 min read

Garbage in, garbage out: keeping your QuickBooks clean

Every report, forecast, and decision you make sits on top of your bookkeeping — and a confident number built on messy books is more dangerous than no number at all. Here's what "garbage" actually looks like in QuickBooks, and the handful of habits that keep it out.

Read it →