Remove last 3
=LEFT(A2,LEN(A2)-3)Keeps everything except the final three characters.
Trim a fixed number of characters from the beginning or end of text.
Trim a fixed number of characters from the beginning or end of text. Use =RIGHT(A2,LEN(A2)-3), then replace the sample ranges with the columns in your sheet.
RIGHT returns the remaining characters after subtracting the first three.
| A | |
|---|---|
| 1 | Imported code |
| 2 | |
| 3 | |
| 4 |
=LEFT(A2,LEN(A2)-3)Keeps everything except the final three characters.
=RIGHT(A2,LEN(A2)-1)Drops one leading character.
=REGEXREPLACE(A2,"^ID-","")Only removes ID- when it appears at the start.
Check LEN first or wrap the formula in IFERROR.
Use REGEXREPLACE for a known prefix rather than a fixed character count.
Check LEN first or wrap the formula in IFERROR.
Use REGEXREPLACE for a known prefix rather than a fixed character count.
Send this recipe to the SheetSteps assistant and describe how your columns are arranged.