How to remove parentheses, dashes and spaces from phone numbers in Excel
Excel formula
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")," ",""),".","")Nest one SUBSTITUTE for each character to delete. In Google Sheets, =REGEXREPLACE(A2,"\D","") removes everything that isn't a digit.
- Result on the example
- one result per row in
B2, filled down toB6 - Works in
- Microsoft 365 only
- Google Sheets
- Different formula, see below
See it work
The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.
How it works
Each SUBSTITUTE deletes one kind of character, and its result feeds the next, so after five of them only digits are left. The result is text, which keeps leading zeros and is what phone systems and lookups usually expect.
Google Sheets can do it in one step: \D means any character that isn't a digit.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")," ",""),".","")Result"6125550142"
A2"(612) 555-0142"The value in A2.
SUBSTITUTE(A2,"(","")"612) 555-0142"SUBSTITUTE: Replaces matching text.- text
A2"(612) 555-0142" - old_text
"(" - new_text
""
- text
SUBSTITUTE(SUBSTITUTE(A2,"(",""),")","")"612 555-0142"SUBSTITUTE: Replaces matching text.- text
SUBSTITUTE(A2,"(","")"612) 555-0142" - old_text
")" - new_text
""
- text
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")"612 5550142"SUBSTITUTE: Replaces matching text.- text
SUBSTITUTE(SUBSTITUTE(A2,"(",""),")","")"612 555-0142" - old_text
"-" - new_text
""
- text
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")," ","")"6125550142"SUBSTITUTE: Replaces matching text.- text
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")"612 5550142" - old_text
" " - new_text
""
- text
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")," ",""),".","")"6125550142"SUBSTITUTE: Replaces matching text.- text
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")," ","")"6125550142" - old_text
"." - new_text
""
- text
In Google Sheets
Google Sheets needs a different formula: =REGEXREPLACE(A2,"\D",""). On the same data it gives the same result. Here it is running in Google Sheets mode.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =CONCAT(IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,"")) | 6125550142, 6515550187, 7635550021… | Excel 365: keeps only the characters that are digits, whatever the punctuation is. |
Common mistakes
- A leading +1 country code leaves 11 digits. Keep the last 10 with
RIGHT(…,10)for US numbers. - Extensions like "x204" stay in with SUBSTITUTE, and their digits are kept by the other versions. Split them off first.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Remove parentheses, dashes and spaces from phone numbers
B2, remove the parentheses, dashes, spaces and dots from the phone number so only the digits remain. Fill down to B6.Questions
How do I format the digits again as (612) 555-0142?
Use ="("&LEFT(B2,3)&") "&MID(B2,4,3)&"-"&RIGHT(B2,4).
How do I get a number instead of text?
Wrap it in VALUE. Numbers with a leading 0 lose it.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.