How to remove a specific character from text in Excel
Formula (Excel and Google Sheets)
=SUBSTITUTE(A2,"-","")Replace it with nothing: =SUBSTITUTE(A2,"-",""). SUBSTITUTE swaps every copy of the character.
- Result on the example
- one result per row in
B2, filled down toB6 - Works in
- Every current version
- Google Sheets
- Same formula
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
SUBSTITUTE replaces every occurrence of the old text with the new text. Replacing "-" with "" (empty text) deletes the dashes and leaves the rest.
=SUBSTITUTE(A2,"-","")Result"5552013344"
A2"555-201-3344"The value in A2.
SUBSTITUTE(A2,"-","")"5552013344"SUBSTITUTE: Replaces matching text.- text
A2"555-201-3344" - old_text
"-" - new_text
""
- text
In Google Sheets
The same formula works in Google Sheets: =SUBSTITUTE(A2,"-",""). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =SUBSTITUTE(SUBSTITUTE(A2,"-","")," ","") | 5552013344, 5558701290, 5554330021… | Nest SUBSTITUTE to remove several characters, here dashes and spaces. |
Common mistakes
- The result is text. Leading zeros are kept, which is what you want for phone numbers and IDs. Wrap in VALUE only when you need a number.
- SUBSTITUTE is case-sensitive: replacing "a" leaves "A" alone.
- To remove only the first copy, use the instance argument:
=SUBSTITUTE(A2,"-","",1).
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 a specific character from text
B2, remove the dashes from the phone number and fill down to B6.Questions
How do I remove everything except numbers?
In Google Sheets use =REGEXREPLACE(A2,"\D",""). In Excel 365, =REGEXREPLACE(A2,"[^0-9]","") does the same.
How do I remove the first or last character?
Use =MID(A2,2,LEN(A2)) to drop the first, or =LEFT(A2,LEN(A2)-1) to drop the last.
Checked by running on 2026-10-29: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.