What it does
SUBSTITUTE replaces specific text inside a cell.
Syntax or pattern
=SUBSTITUTE(text, old_text, new_text, [instance_num])5 practical examples
Remove dashes from codes
Turn product codes into plain text.
=SUBSTITUTE(A2,"-","")Useful before matching IDs.
Replace old labels
Change βPendingβ to βOpenβ.
=SUBSTITUTE(A2,"Pending","Open")Works on exact text fragments.
Remove spaces
Delete all spaces from a code.
=SUBSTITUTE(A2," ","")Different from TRIM, which keeps single spaces.
Replace only first instance
Replace the first slash only.
=SUBSTITUTE(A2,"/","-",1)The final argument controls which instance is replaced.
Normalize phone numbers
Remove common punctuation.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"-",""),"(",""),")","")Nested SUBSTITUTE can clean simple patterns.
Common mistakes to avoid
- Not handling missing delimiters.
- Forgetting that some text functions return text, not numbers.
- Using fixed positions when the text layout is not consistent.
Related Excel examples
FAQ
Can text formulas work with Excel Tables?
Yes. Table references can make text-cleaning formulas easier to understand.
Here are some ideas for you
Optional resources that may help if you are learning formulas, building reports, or working in spreadsheets often.
- Excel formula booksSee ideas
Practice formulas with structured examples you can keep beside your desk.
- Excel shortcut guidesSee ideas
Build speed with keyboard shortcuts for selection, formatting and navigation.
- Numeric keypadsSee ideas
Helpful if you enter many numbers on a laptop or compact keyboard.
- External monitorsSee ideas
Useful for viewing large worksheets, formulas and reference tables side by side.
- Desk notebooksSee ideas
Sketch formula logic, report ideas and table structures before building.
- Laptop standsSee ideas
Make long spreadsheet sessions more comfortable and ergonomic.
Some links in this section may be affiliate links. Choose only what is useful for your own work.