# SUBSTITUTE formula generator

> Describe what you need and get a SUBSTITUTE formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested SUBSTITUTE examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/substitute · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

SUBSTITUTE replaces specific text with new text everywhere it appears, or only at the occurrence you choose.

Describe the task at [SUBSTITUTE formula generator](https://spreadsheetpractice.com/tools/formula-generator/substitute) and get a SUBSTITUTE formula for Excel and Google Sheets, tested on real data.

## Tested SUBSTITUTE examples

### Remove a specific character from text

`=SUBSTITUTE(A2,"-","")`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/remove-a-character-from-text)

### Replace multiple values at once with a formula

`=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,$D$2,$E$2),$D$3,$E$3),$D$4,$E$4),$D$5,$E$5)`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/replace-multiple-values-at-once)

### Convert percentage text to a number

`=VALUE(A2)`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/convert-percentage-text-to-number)

### Remove all spaces from a cell

`=SUBSTITUTE(A2," ","")`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/remove-all-spaces-from-a-cell)

### Remove a specific word from a cell

`=TRIM(SUBSTITUTE(A2,$E$1,""))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/remove-a-specific-word-from-a-cell)

### Why does VALUE return #VALUE! for numbers with units

`=VALUE(SUBSTITUTE(A2," kg",""))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/value-function-error-with-units)

### Count a specific character in a cell

`=LEN(A2)-LEN(SUBSTITUTE(A2,$E$1,""))`

Excel. Result on the sample sheet: 8 rows (B2:B9). [See it and try it](https://spreadsheetpractice.com/formulas/count-a-specific-character-in-a-cell)

### Convert numbers with comma decimals to real numbers

`=VALUE(SUBSTITUTE(SUBSTITUTE(A2,".",""),",","."))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-comma-decimal-numbers)

## Questions

### What does the SUBSTITUTE formula generator do?

You describe the task in plain English, and it writes the formula, using SUBSTITUTE where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does SUBSTITUTE do?

SUBSTITUTE replaces specific text with new text everywhere it appears, or only at the occurrence you choose.

### Can I learn to write SUBSTITUTE formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the SUBSTITUTE function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
