Records that should match often don’t — "Acme Inc." vs "ACME INC". Build a normalized key — trimmed, cleaned, uppercased, punctuation removed — so lookups and dedup compare apples to apples.
The example
"Acme Inc." and "ACME INC" → ACME INC.
| A | B | |
|---|---|---|
| 1 | Raw | Key |
| 2 | Acme Inc. | ACME INC |
The formula
The formula:
How it works
How it works:
- Swap non-breaking spaces (CHAR 160) for normal ones, then
CLEANremoves control characters. - Strip punctuation like periods and commas with nested
SUBSTITUTE. TRIMcollapses extra spaces;UPPERremoves case differences.- Compute the key on both lists and match on it — not the raw text.
Normalize both sides, then VLOOKUP the key. Add a key column to each table with the same formula, and join on the key instead of the messy original. This single technique fixes the bulk of “why won’t my lookup match” problems — case, stray spaces, hidden CHAR(160), and trailing punctuation all vanish into one canonical string.
Try it: interactive demo
Two values that should match.
Variations
Remove all spaces
Strictest key:
Strip more punctuation
Commas too:
Match on the key
Lookup:
Pitfalls & errors
Same key both sides. Apply the identical formula to both lists before matching.
Don’t over-strip. Removing too much can merge distinct records — balance it.
Keep the original. The key is for matching; display the raw value.
Practice workbook
Frequently asked questions
How do I build a match key in Excel?
Why won't my VLOOKUP match identical-looking text?
Should I remove all spaces?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class