How do i remove the last character of a string in excel?

In this article, I will show you the effective six ways to remove last character in Excel. Sometimes it is needed to extract different texts from a cell by removing the last character. It can be done by typing manually but it is not effective. So, let’s dive into this article and get to know the ways to remove the last character in Excel according to your needs.

Download Workbook

6 Ways to Remove Last Character in Excel

Here, I have a dataset where I am showing four columns; Student Id, Name, Course No, Email Id. Using this data I will try to show you the ways of removing the last character and extracting necessary data.

How do i remove the last character of a string in excel?

Method-1: Using REPLACE Function for Removing Last Character Only

Suppose Student Id consists of 5 characters among them first 4 are for a year and the last one is roll number as per this example. Thus, to extract the year from this Student Id you have to remove the last character using the REPLACE Function. The extracted values will be shown in the Year Column.

How do i remove the last character of a string in excel?

Step-1:
Select the output Cell E5.
➤Type the following function

=VALUE(REPLACE(B5,LEN(B5),1,""))

Here, B5 is the old text, LEN(B5) will return the length of the text and in this case, it is 5 thus 5 will be start_num, 1 is num_chars and new text is Blank.
The Value Function will convert the string to a number.

How do i remove the last character of a string in excel?

Step-2:
➤Press ENTER and you will get the output.
➤Drag down the Fill Handle

How do i remove the last character of a string in excel?

Result
In this way, the following result will appear.

How do i remove the last character of a string in excel?

📓 Note
Using REPLACE Function you will not be able to remove more than one character from last.

Read more: How to Remove the Last 3 Characters in Excel

Method-2: Using LEFT Function

In the Course No column different course names have been created with the Department Name and number. To extract the Department from this Course No you have to remove the last three digits using the LEFT Function.

How do i remove the last character of a string in excel?

Step-1:
➤Select the output Cell E5.
➤Use the following formula

Here, D5 is text and LEN(D5)-3 = 5-3=2 is num_chars. So the first two characters will appear as an output.

How do i remove the last character of a string in excel?

Step-2:
➤Press ENTER and you will get the output.
➤Drag down the Fill Handle

How do i remove the last character of a string in excel?

Result
Then you will get the following result.

How do i remove the last character of a string in excel?

Read more: How to Remove Characters in Excel

Method-3: Using MID Function

In the Course No column different course names have been created with the Department Name and number. To extract the Department from this Course No you have to remove the last three digits using the MID Function.

How do i remove the last character of a string in excel?

Step-1:
➤Select the output Cell E5.
➤Use the following formula

Here, D5 is text, 1 is the start num, LEN(D5)-3 is num_char

How do i remove the last character of a string in excel?

Step-2:
➤Press ENTER and you will get the output.
➤Drag down the Fill Handle

How do i remove the last character of a string in excel?

Result
Now you will get the output in the Department column.

How do i remove the last character of a string in excel?

Read more: Excel Remove Characters From Right

Method-4: Using Flash Fill to Remove Last Character

In the Course No column different course names have been created with the Department Name and number. To extract the Department from this Course No you have to remove the last three digits using the Flash Fill feature.

How do i remove the last character of a string in excel?

Step-1:
➤Select the output Cell E5.
➤Type the Department Name according to Cell D5.

How do i remove the last character of a string in excel?

Step-2:
➤In Cell E6 start typing as the previous one and then as following the Department names will be suggested.

How do i remove the last character of a string in excel?

Step-3:
➤Press ENTER and the following outputs will appear.

How do i remove the last character of a string in excel?

Read more: How to Remove Characters from Left in Excel

Method-5: Removing First and Last Characters Simultaneously

Suppose in the Email Id column I have some Email Ids but they are combined with some special characters at the start and end of these Ids. Now I want to omit these signs at the first and last place simultaneously using the MID Function.

How do i remove the last character of a string in excel?

Step-1:
➤Select the output Cell E5.
➤Use the following formula

Here, D5 is text, 3 is the start num, LEN(D5)-4 is num_char
3 is used as start num because there are 2 special characters before Email Id
and 4 is subtracted from the total character length in num_char  because there is total of 4 special characters which you want to omit.

How do i remove the last character of a string in excel?

Step-2:
➤Press ENTER and you will get the output.
➤Drag down the Fill Handle

How do i remove the last character of a string in excel?

Result
Now the following results will appear.

How do i remove the last character of a string in excel?

Read more: How to Remove Special Characters in Excel

Method-6: Using VBA Code

You can use VBA code also to remove the last character like in Method-2 or Method-3.

Step-1:
➤Select Developer Tab >>Visual Basic Option

How do i remove the last character of a string in excel?

Step-2:
Visual Basic Editor will open
➤Select Insert Tab >>Module Option

How do i remove the last character of a string in excel?

Step-3:
Module 1 will be created.

How do i remove the last character of a string in excel?

Step-4:
➤Write the following code here.

Public Function RmvLstCh(txt As String, char_no As Long)

RmvLstCh = Left(txt, Len(txt) - char_no)

End Function

This Code will create a function named RmvLstCh
Save the code and Close the window.

How do i remove the last character of a string in excel?

Step-5:
➤Select the output Cell E5
➤Type the function name here.

How do i remove the last character of a string in excel?

Step-6:
➤Press ENTER and you will get the output.
➤Drag down the Fill Handle

How do i remove the last character of a string in excel?

Result
After that, the following results will appear.

How do i remove the last character of a string in excel?

Practice Section

For doing practice by yourself we have provided a Practice section like below for each method in each sheet on the right side. Please do it by yourself.

How do i remove the last character of a string in excel?

Conclusion

In this article, I tried to cover the easiest ways to remove the last character in Excel effectively. Hope you will find it useful. If you have any suggestions or questions feel free to share them with us.


Further Readings

  • How to Remove Spaces in Excel: With Formula, VBA & Power Query
  • Remove Specific Characters in Excel ( 5 Ways)
  • Remove First Character from String in Excel (6 Quick Ways)
  • Remove Characters from Left in Excel (6 Ways)
  • How to Remove the First Character from a String in Excel with VBA
  • VBA to Remove Characters from String in Excel (7 Methods)

How do I remove the last character from a value in Excel?

6 Ways to Remove Last Character in Excel.
Method-1: Using REPLACE Function for Removing Last Character Only..
Method-2: Using LEFT Function..
Method-3: Using MID Function..
Method-4: Using Flash Fill to Remove Last Character..
Method-5: Removing First and Last Characters Simultaneously..
Method-6: Using VBA Code..

How do I remove the last 3 characters from a string in Excel?

LEN(D5)-3 ▶ calculates the length of the text, “Jason Roy” and then subtracts the result with 3..
D5 ▶ refers to the cell address of the text “Jason Roy”..
=LEFT(D5,LEN(D5)-3) ▶ truncates the last 3 characters i.e. “Roy” from the text “Jason Roy”..

How do I remove a character from the left of a string in Excel?

Remove characters from left side of a cell.
=REPLACE(old_text, start_num, num_chars, new_text).
=RIGHT(text,[num_chars]).
=LEN(text).