How to Remove Characters From Text in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
To remove a specific character, use SUBSTITUTE to replace it with nothing: =SUBSTITUTE(A2,"-","") strips every dash. To remove characters by position, use RIGHT(A2,LEN(A2)-3) to drop the first three, or LEFT(A2,LEN(A2)-2) to drop the last two. To remove everything after a character, use TEXTBEFORE or LEFT with FIND.
Key takeaways
- SUBSTITUTE(A2,"x","") removes every copy of a character; nest SUBSTITUTEs to remove several characters.
- RIGHT(A2,LEN(A2)-n) removes the first n characters, and LEFT(A2,LEN(A2)-n) removes the last n.
- TEXTBEFORE, or LEFT with FIND, removes everything after a marker such as a dash.
- SUBSTITUTE is case-sensitive, so "a" doesn't remove "A".
- The result is text; wrap it in VALUE when the cleaned value should be a number.
On this page+
- Which method should you use?
- Remove a specific character with SUBSTITUTE
- Remove several characters at once
- Remove a word or a longer piece of text
- Remove the first or last characters
- Remove everything before or after a character
- Remove characters with Find and Replace
- Remove invisible characters
- Practise it
To remove characters in Excel, choose the method by what you know about the characters: what they are, or where they are. SUBSTITUTE removes a specific character wherever it appears, such as every dash in a phone number. LEFT, RIGHT and REPLACE remove characters by position, such as the first three or the last two. This guide shows each method with worked examples, plus Find and Replace for quick one-off fixes.
Which method should you use?#
Start with the question "do I know which character, or where it is?":
| You want to remove | Formula | "ID-48213" or similar becomes |
|---|---|---|
| Every copy of one character | =SUBSTITUTE(A2,"-","") | ID48213 |
| Several different characters | Nested SUBSTITUTE | See below |
| The first n characters | =RIGHT(A2,LEN(A2)-3) | 48213 |
| The last n characters | =LEFT(A2,LEN(A2)-2) | ID-482 |
| Everything after a marker | =TEXTBEFORE(A2,"-") | ID |
| Spaces | =TRIM(A2) or SUBSTITUTE | See the spaces guide |
Spaces are a special case with their own tricks, so they have a separate guide: how to remove spaces in Excel.
Remove a specific character with SUBSTITUTE#
SUBSTITUTE replaces text with other text. Replace a character with nothing, two double quotes, and it disappears:
=SUBSTITUTE(A2,"-","")With "555-123-4567" in A2, the result is 5551234567. SUBSTITUTE has three required parts: the text, what to find, and what to put instead. It changes every copy it finds.
To remove only one copy, use the optional fourth argument, the instance number. =SUBSTITUTE(A2,"-","",1) removes only the first dash: 555123-4567. The SUBSTITUTE function guide covers all four arguments.
SUBSTITUTE is case-sensitive: =SUBSTITUTE(A2,"x","") leaves capital X untouched. To remove both, nest two SUBSTITUTEs, one for each case.
Remove several characters at once#
To remove more than one kind of character, put SUBSTITUTE inside SUBSTITUTE. Each one cleans the result of the one inside it. For "(555) 123-4567":
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"(",""),")",""),"-","")," ","")Work from the inside out: the first SUBSTITUTE removes "(", the next removes ")", then "-", then the space. The result is 5551234567.
Nested formulas get long, so build them one layer at a time and check the result after each layer. In Microsoft 365, you can also remove every non-digit with one formula:
=TEXTJOIN("",TRUE,IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,""))MID and SEQUENCE split the text into single characters, *1 turns digits into numbers and everything else into an error, IFERROR blanks the errors, and TEXTJOIN joins the digits back together. The result is again 5551234567.
Remove a word or a longer piece of text#
SUBSTITUTE isn't limited to single characters. It can remove a whole word or phrase, such as "Ltd" from company names:
=TRIM(SUBSTITUTE(A2,"Ltd",""))For "Redwood Paper Ltd", SUBSTITUTE removes "Ltd" and leaves a space at the end, and TRIM tidies it up. The result is Redwood Paper. Be careful with short words: removing "Co" would also cut it from the middle of names like "Cooper". Include a space before the word, such as " Co", to make the match more specific.
Remove the first or last characters#
When the characters you want to remove are always in the same place, work by position. LEN counts the characters in the cell, and you keep everything except the part you don't want.
To remove the first three characters of "ID-48213" (8 characters long):
=RIGHT(A2,LEN(A2)-3)LEN(A2) is 8, so RIGHT keeps the last 8 - 3 = 5 characters: 48213. =REPLACE(A2,1,3,"") does the same by replacing the first three characters with nothing. The guide to removing the first characters covers more variations.
To remove the last two characters, such as "kg" from "125kg":
=LEFT(A2,LEN(A2)-2)The result is 125, as text. Wrap it in VALUE to get a number you can add up: =VALUE(LEFT(A2,LEN(A2)-2)). Counting characters is explained further in how to count characters and words.
Remove everything before or after a character#
To remove everything after a marker, keep only the text before it. For "Blue Shirt - Large":
=TEXTBEFORE(A2," - ")The result is Blue Shirt. In older Excel, find the marker's position and take everything to its left: =LEFT(A2,FIND(" - ",A2)-1).
To remove everything before a marker, use TEXTAFTER: =TEXTAFTER(A2," - ") returns Large. TEXTBEFORE and TEXTAFTER need Microsoft 365 or Excel 2024. If you need the text between two markers instead, see extracting text between characters.
Remove characters with Find and Replace#
For a one-off clean-up, Find and Replace removes characters without any formula:
- Select the cells.
- Press Ctrl+H (Mac: ⌃H).
- Type the character in Find what and leave Replace with empty.
- Click Replace All.
Find and Replace understands wildcards. To remove brackets and everything inside them, such as " (old)" in product names, find (*) and replace with nothing. An asterisk stands for any characters. To find a real asterisk, type ~*.
Unlike a formula, Find and Replace changes the original cells, so save a copy or be ready to undo (Windows: Ctrl+Z; Mac: ⌘Z). Select only the cells you want to change first; with a single cell selected, Excel searches the whole sheet.
Remove invisible characters#
Some characters can't be seen but still break formulas. CLEAN removes non-printing characters, such as line breaks, from imported text: =CLEAN(A2). Non-breaking spaces from web pages are character 160, and SUBSTITUTE can remove them: =SUBSTITUTE(A2,CHAR(160),"").
If a character won't go away, check its character number with the CODE function, or copy it straight from the cell into your formula. Many "dashes" are actually longer en or em dashes, which are different characters. For a full clean-up routine, see the guide to cleaning messy data.
Practise it#
Removing unwanted characters is one of the most common data-cleaning tasks in real jobs and in tests. Practise cleaning text in a live spreadsheet: you type SUBSTITUTE, TRIM and CLEAN formulas, and each result is checked instantly. Then try the data analyst Excel test to clean data under time pressure.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Phone numbers must have no dashes. In B2, use SUBSTITUTE to remove every - from A2.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Digits only | |||
| 2 | 555-123-4567 | |||
| 3 | 555-987-6543 | |||
| 4 | 555-246-8100 | |||
| 5 | 555-310-7722 | |||
| 6 | ||||
| 7 | ||||
| 8 |
Tip: SUBSTITUTE needs the cell, the text to remove ("-"), and what to put instead: two quotes with nothing between.
Practise this in a lesson
Frequently asked questions
How do I remove a specific character in Excel?
Use SUBSTITUTE with an empty replacement: =SUBSTITUTE(A2,"-","") removes every dash. Or select the cells, press Ctrl+H, type the character in Find what, leave Replace with empty and click Replace All.
How do I remove the first 3 characters in Excel?
Use =RIGHT(A2,LEN(A2)-3), or =REPLACE(A2,1,3,""). Both return the text without its first three characters.
How do I remove the last character in Excel?
Use =LEFT(A2,LEN(A2)-1). Change the 1 to remove more characters from the end, for example 2 to remove a unit like kg.
How do I remove several different characters at once?
Nest SUBSTITUTE functions, one per character: =SUBSTITUTE(SUBSTITUTE(A2,"(",""),")","") removes both brackets. Each SUBSTITUTE cleans the result of the one inside it.
Why does SUBSTITUTE not remove a character?
SUBSTITUTE is case-sensitive, and the character may look the same but be different, such as a non-breaking space or a long dash. Copy the character from the cell into the formula to be sure.