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.

Meet your AI CFO →

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 →
Finance 101August 10, 2026 · 8 min read

Why your Shopify sales will never match your QuickBooks revenue

Your Shopify dashboard says one number, your P&L says another, and they never tie. That's not a bug — it's accounting. Here's the bridge from channel sales down to book revenue, line by line, and how to tell a normal gap from one that's actually a problem.

Read it →
ProductAugust 9, 2026 · 4 min read

Wauvel now reads your Shopify sales — meet your Sales Analyst

Connect your Shopify store in a few clicks and a new Sales section lands on your Command Center — net sales, orders, average order value, and a weekly trend. Read-only, and the first of a family: the Sales Analyst is source-agnostic, so Stripe, Faire, and more plug into the same view over time.

Read it →
Finance 101August 8, 2026 · 6 min read

Sales tax isn't revenue: the number that fools every online seller

Your store's "total sales" number includes the sales tax you collected — and that money was never yours. It's a liability you're holding for the state until you remit it, not revenue. Book it as revenue and you inflate your top line, distort your margins, and start spending cash you already owe.

Read it →
Finance 101August 7, 2026 · 8 min read

Planning cash for Q4: the inventory buy that breaks holiday brands

For a product brand, Q4 is where you make your year — and the cash math runs backwards. You pay for the holiday inventory in August, the revenue lands in December, and the cash from those sales lands later still. A profitable holiday can still punch a hole in your bank account in the middle. Here's how to find the trough before it finds you.

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

Get paid faster: how to cut your DSO and free cash you already earned

You already did the work and booked the sale — the money is just sitting in someone else's account. DSO measures how long. Here's how a CFO reads days sales outstanding, turns each day into dollars, and works down the number with a collections playbook that doesn't cost you a customer.

Read it →