To remove the last character from a cell, use =LEFT(A1,LEN(A1)-1). LEN counts the characters in the cell, subtracting 1 tells LEFT to keep everything except the final one.
To remove more than one character, change the number — =LEFT(A1,LEN(A1)-3) drops the last three. If the text has a trailing space that gets left behind, wrap it in TRIM: =TRIM(LEFT(A1,LEN(A1)-1)).
In Excel 365 you can do the same thing with =TEXTBEFORE(A1,RIGHT(A1,1)), and if you just want to strip a known character like a comma or semicolon, =SUBSTITUTE(A1,",","") is simpler than counting positions.
Let’s say you have a list of product codes in Excel, and each code ends with a letter that indicates a specific batch. Your manager asks you to remove the last letter from each product code to standardize them for a new system.
For example, if you have the text string “EXCEL CHAMPS 1,” you should change it to “EXCEL CHAMPS.”

Quick Solution: To do this, you can use a simple formula. In the cell where you want to get the text, type =LEFT(A1, LEN(A1) – 1), assuming the original text is in cell A1.
This formula takes the text in A1 and removes the last character, giving you just the product code without the batch letter. Copy this formula down the column to quickly apply it to all your product codes.
In this tutorial, you will learn this and all the other methods in detail. So, let’s get started.
Remove the Last Character (or N Characters) from the Right with LEFT + LEN
Use the below steps to write this formula:
- First, enter the LEFT function in a cell, and in the first argument, refer to the cell with the original text.
- Next, in the second argument of LEFT, enter the LEN function.
- After that, in the LEN function, refer to the same cell (A1) and then close the LEN function with a closing parenthesis.
- In the end, subtract 1 from the LEN function within the [num_chars] and close the LEFT function.

When you hit enter, you are given a new string derived from the original string after removing the last character.
=LEFT(A1,LEN(A1)-1)
To remove more than one character, replace 1 with the number of characters you want to remove. For example, the following formula removes the last 2 characters:
=LEFT(A1,LEN(A1)-2)
For a blank cell, this formula returns the #VALUE! error (LEN gives 0, and LEFT can’t take -1 characters). To leave blank cells blank, use this version:
=IF(A1="","",LEFT(A1,LEN(A1)-1))
You can also use TRIM to remove any unwanted space you have after and before the string. Our example has a space between the “Champs” and “1”.

And when you remove the last character, the space stays with the string. See the snapshot below.

That’s why it’s better to use TRIM along with LEFT and LEN:
=TRIM(LEFT(A1,LEN(A1)-1))
Using the MID and LEN Functions
In this formula, the MID function returns a substring starting from the first character and ending at the character before the last one.
=MID(A1, 1, LEN(A1) - 1)
To understand this formula, let’s split it into parts:
- MID(A1, 1, LEN(A1) – 1): This part uses the MID function to extract a part of the text from cell A1.
- A1: This is the cell containing the text you want to modify.
- 1: This tells the MID function to start extracting from the first character of the text.
- LEN(A1) – 1: This calculates the length of the text in A1 and subtracts 1, giving you the number of characters to extract, which is all characters except the last one.
Create a Custom Function with VBA to Remove Characters from the Right
Here we have a VBA custom function that allows you to remove a specified number of characters from the end of a string.
Function RemoveLastChars(inputString As String, numCharsToRemove As Integer) As String
' Check if the number of characters to remove is greater than the length of the input string
If numCharsToRemove >= Len(inputString) Then
' If so, return an empty string
RemoveLastChars = ""
Else
' Otherwise, return the string with the specified number of characters removed from the end
RemoveLastChars = Left(inputString, Len(inputString) - numCharsToRemove)
End If
End Function
To use this custom function, first, open an Excel workbook and press ALT + F11 to open the VBA editor. Then, insert a new module by right-clicking on any existing module (or the workbook name) and selecting Insert > Module.
In the end, paste the code into the new module, close the VBA editor, and go back to your workbook. Now, you can use RemoveLastChars in your worksheet. Save the file as a macro-enabled workbook (.xlsm) to keep the function.
=RemoveLastChars(A1, 1)
Remove the Last Character Only If It Is a Specific Character
Sometimes you only want to remove the last character when it’s a specific one, like a trailing comma. Use RIGHT to check the last character first:
=IF(RIGHT(A1,1)=",",LEFT(A1,LEN(A1)-1),A1)
If the last character is a comma, the formula removes it. Otherwise, it returns the value as it is.
Remove the Last Character from a Number
LEFT, MID and REPLACE always return text, even when you use them on a number. So, “12345” becomes the text “1234”, which SUM ignores. Add — in front of the formula to get a number back:
=--LEFT(A1,LEN(A1)-1)
Keep in mind that a formatted number may look different from what’s stored in the cell (like 1,234.50 stored as 1234.5), and LEFT works on the stored value.
Remove the Last Character without a Formula
If you want fixed values, use Flash Fill. In the next column, type the first value without its last character, select the cell below it, and press Ctrl + E. Excel fills the rest of the column using the same pattern.
Frequently Asked Questions
How do I remove the first character instead?
Use RIGHT instead of LEFT, so the formula keeps everything except the first character:
=RIGHT(A1,LEN(A1)-1)
Can I use REPLACE to remove the last character?
Yes. REPLACE can replace the last character with nothing:
=REPLACE(A1,LEN(A1),1,"")
Why is there still a space at the end of the result?
The character before the one you removed was a space, so it’s now the last character. Wrap the formula in TRIM, as shown above, to remove it.
Written by
Puneet Gogia
Microsoft MVP — Excel · Founder, Excel Champs
Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.