Excel Worksheet Tips: Remove First and Last Character From a String
Perhaps you have a list of data that you wish to remove the first and last characters. For example, there is a list of values similar to these:
“Data”
“Trial”
“Test”
What you are after is the strings inside the inverted commas. You could go through each entry and edit them, or using the formula below:
=TRIM(LEFT(RIGHT(A1,LEN(A1-1),LEN(RIGHT(A1,LEN(A1)-1))-1))
Using this formula, it will format the results to look like this:
Data
Trial
Test
If you wish to remove two characters from the ends, change the -1 values to -2.
Or perhaps you only want to remove the FIRST character. If so, use the following code:
=RIGHT(A1,LEN(A1)-1)
Or to remove the LAST character, use the following code:
=LEFT(A1,LEN(A1)-1)
Useful!
Come check out the directory for the rest of my excel tips!
Submeg
IT
Awesome
LikeLike
Hello. For some reason the =TRIM(LEFT(RIGHT(A1,LEN(A1-1),LEN(RIGHT(A1,LEN(A1)-1))-1)) is not working for me in Excel 2010… Any thoughts?
LikeLike
For anyone struggling. Replace “RIGHT(A1,LEN(A1-1)” with RIGHT(A1,LEN(A1)-1)”.
LikeLike