How can I remove the last 5 characters from a cell...

lgoldberg

New Member
Joined
Jul 23, 2007
Messages
4
Is there an excel function to cut x number of characters from the end of a line of text? I want to remove the last 5 characters from each cell (all in column A). These are not blank spaces. The characters (zip codes) are different on every line (there are about 500).

thank you!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Is there an excel function to cut x number of characters from the end of a line of text? I want to remove the last 5 characters from each cell (all in column A). These are not blank spaces. The characters (zip codes) are different on every line (there are about 500).

thank you!

Assuming the cell is A1:

=LEFT(A1,LEN(A1)-5)

Copy down.
 
Upvote 0
Not working...

Thank you for the quick reply. however, this did not work properly. This command is displaying, not *removing*, the text from the cell. Additionally, it is not just taking 5 characters, it is taking almost the entire string.

Anything else I can try?
 
Upvote 0
That should have worked. This should only display the left most characters minus the last 5 characters. I have just tried this

=LEFT(C26,(LEN(C26)-5)) and I got the results that PATSYS listed already.
 
Upvote 0
the function works wonderfully for me.... I put 123456789 into cell A1 and the formula into B1 and got 1234 in B1, if I then copy and pastespecial values, the actual cell is 1234, not simply displaying. Are the answers it is giving you consistently wrong in a specific way other than displaying not removing?
 
Upvote 0
You could also use:
=REPLACE(A1,6,5,"")
which will also work if some of the zip codes don't have the 4 digit extension.

But how did it not work for you?

Both formulas are in this sample:
Book8
ABCD
191256-12349125691256
291222-04569122291222
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,891
Members
449,058
Latest member
Guy Boot

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top