Phone numbers arrive in every format — dots, dashes, parentheses, spaces. Strip everything to digits, then reformat consistently so they sort, match, and dial reliably.
The example
972.555.1234 → (972) 555-1234.
| A | B | |
|---|---|---|
| 1 | Raw | Clean |
| 2 | 972.555.1234 | (972) 555-1234 |
The formula
The formula:
How it works
How it works:
- Strip non-digits by nesting
SUBSTITUTEto remove dots, dashes, spaces, and parentheses. - Wrap in
VALUEto turn the digit string into a number, thenTEXT(…, "(000) 000-0000")reformats it. - The 0 placeholders keep leading digits and insert the punctuation.
- Keep a digits-only version too — it’s the reliable key for matching and deduping.
Match on digits, display with format. Store the bare 10-digit string for lookups and dedup (so “(972) 555-1234” and “972-555-1234” match), and apply the TEXT format only for display. For variable lengths or extensions, clean to digits first and branch on LEN to choose the format.
Try it: interactive demo
Enter a phone number any way.
Variations
Digits-only key
For matching:
Dashed format
xxx-xxx-xxxx:
Last 4 digits
For display:
Pitfalls & errors
Strip every separator. Nest a SUBSTITUTE for each character that appears.
Leading zeros. TEXT with 0 placeholders preserves them; storing as a number alone may drop them.
Extensions/lengths vary. Branch on LEN for non-10-digit numbers.
Practice workbook
Frequently asked questions
How do I standardize phone numbers in Excel?
How do I match phones in different formats?
How do I keep leading zeros?
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