Remove the last N characters from a cell
=LEFT(A2,LEN(A2)-$E$1)Excel · result on the sample sheet: 5 rows (B2:B6)
Describe what you need and get a working REPLACE formula for Excel and Google Sheets, tested on real data before you copy it. REPLACE swaps out a set number of characters at a given position, whatever those characters are.
Each formula below was calculated on its own sample sheet. Open one to see the sheet, why it works, and to try it yourself.
=LEFT(A2,LEN(A2)-$E$1)Excel · result on the sample sheet: 5 rows (B2:B6)
=RIGHT(A2,LEN(A2)-$E$1)Excel · result on the sample sheet: 6 rows (B2:B7)
=REPLACE(A2,$E$1,0,$G$1)Excel · result on the sample sheet: 5 rows (B2:B6)
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.
REPLACE swaps out a set number of characters at a given position, whatever those characters are.
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.