# REPLACE formula generator

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

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

REPLACE swaps out a set number of characters at a given position, whatever those characters are.

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

## Tested REPLACE examples

### Remove the last N characters from a cell

`=LEFT(A2,LEN(A2)-$E$1)`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/remove-last-n-characters)

### Remove the first N characters from a cell

`=RIGHT(A2,LEN(A2)-$E$1)`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/remove-first-n-characters)

### Insert a character at a specific position in text

`=REPLACE(A2,$E$1,0,$G$1)`

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

## Questions

### What does the REPLACE formula generator do?

You describe the task in plain English, and it writes the formula, using REPLACE 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 REPLACE do?

REPLACE swaps out a set number of characters at a given position, whatever those characters are.

### Can I learn to write REPLACE 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 REPLACE 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.
