Chopping off the leftmost or rightmost character of a string in Excel

You can use the LEFT and RIGHT functions in the Microsoft Excel spreadsheet program along with the LEN (length) function to remove the leftmost or rightmost character from a text string. These functions also work in Google Sheets, LibreOffice Calc, which is the spreadsheet component of the LibreOffice software package, and Apache OpenOffice Calc, which is the spreadsheet program included in Apache OpenOffice, though in the Apache OpenOffice Calc program you need to substitute semicolons (;) for commas (,) in the formulas. E.g., in Apache OpenOffice Calc you would need to use =RIGHT(A5;LEN(A5) -1) , instead of =RIGHT(A5,LEN(A5) -1) as you would in the other programs.

Removing the leftmost character

The syntax for the RIGHT function is RIGHT(text,[numchars]). If you don't include numchars, i.e., you use RIGHT(text) then the value returned is the rightmost character in the string. E.g., if cell A1 has 1ABC in it, then =RIGHT(A1) returns C. But suppose, instead, you want to remove the leftmost charaacter from a string. You can use the RIGHT function to do so. E.g., suppose I have a column of values, e.g.:

Excel: Learn basic and advanced formulas quick and easy
Excel: Learn basic and advanced
formulas quick and easy
1x1px

 AB
11ABC 
22DEF 
33GHI 
44JKL 
55MNO 

If I want to remove the number at the beginning of each text string and put the shortened strings in column B, I could, since the strings are all 4 characters long, use =RIGHT(A1,3) in column B1 and then copy the formula down through the other cells in column B by clicking in cell B1 and holding down the leftmost mouse button and dragging downwards through the other cells in column B and then hitting Ctrl-D.

But suppose the strings vary in length. I.e., suppose I have a worksheet containing the following strings in column A:

Excel - beginner to HIRED!
Excel - beginner to HIRED!
0x0

 AB
11ABC 
22DEFG 
33HI 
44JKL 
55MNOP 

In the above example, I could use the length (LEN) and right functions. E.g., I could use the formula =RIGHT(A1,LEN(A1) - 1) in cell B1, which would return ABC, but if I copied that formula into the other cells in column B, it would chop off the leftmost character in the cells in column A even when the length of the text varied, since the LEN function would return the length of the entire string and LEN(A1 - 1) would substract one from the length. The RIGHT function would then count that many characters from the right side of the string towards the left side, but, since the RIGHT function is counting using length minus 1, it omits the very first character in the string.

oreilly.com - Your tech ebook super store
 AB
11ABCABC
22DEFGDEFG
33HIHI
44JKLJKL
55MNOPMNOP

Removing the rightmost character

The syntax for the LEFT function is LEFT(text,[numchars]). If you don't include numchars, i.e., you use LEFT(text) then the value returned is the leftmost character in the string. E.g., if cell A1 has 1ABC in it, then =LEFT(A1) returns 1. But suppose, instead, you want to remove the rightmost charaacter from a string. You can use the LEFT function to do so. E.g., suppose I have a column of values, e.g.:

Microsoft Excel 103 - Advanced Excel
Microsoft Excel 103 - Advanced Excel
1x1px

 AB
11ABC 
22DEF 
33GHI 
44JKL 
55MNO 

If I want to remove the last character from each cell in column A and put the shortened strings in column B, I could, since the strings are all 4 characters long, use =LEFT(A1,3) in column B1 and then copy the formula down through the other cells in column B by clicking in cell B1 and holding down the leftmost mouse button and dragging downwards through the other cells in column B and then hitting Ctrl-D to copy the formula to the other cells.

But suppose the strings vary in length. E.g.:

New Tricks: Easy Excel
New Tricks: Easy Excel
1x1px

 AB
11ABC 
22DEFG 
33HI 
44JKL 
55MNOP 

I could use the formula =LEFT(A1,LEN(A1) - 1) column B1 to get 1AB in column B1. If I copied the formula down through the other cells in B, I would get the following results.

 AB
11ABC1AB
22DEFG2DEF
33HI3H
44JKL4JK
55MNOP5MNO

The formula LEFT(text,LEN(text) - 1) functions similar to the CHOP function in Perl.

Tested with Excel 2016, LibreOffice 5.2.3.3, and Apache OpenOffice 4.1.3.