# How to remove a specific character from text in Excel

Replace it with nothing: =SUBSTITUTE(A2,"-",""). SUBSTITUTE swaps every copy of the character.

**Excel:** `=SUBSTITUTE(A2,"-","")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Phone | Digits only |
| 555-201-3344 |  |
| 555-870-1290 |  |
| 555-433-0021 |  |
| 555-019-7735 |  |
| 555-662-4800 |  |

Formula in B2, filled to B6: `=SUBSTITUTE(A2,"-","")`

Result: 5552013344; 5558701290; 5554330021; 5550197735; 5556624800

## 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.

## Other ways

- `=SUBSTITUTE(SUBSTITUTE(A2,"-","")," ","")`: 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)`.

## 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.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-29.

Source: https://spreadsheetpractice.com/formulas/remove-a-character-from-text
