Eliminating a Fixed Number of Characters in a Data String

RhyGuy

Board Regular
Joined
Jan 12, 2009
Messages
79
Hi All,

I have a list of data, all of which follows a similar format, in that it ends with the same number of characters (ie " - AB"). The preceeding number of characters is variable, but it always ends with the same format and number of characters. What I want to do is remove those four characters at the end of the text string. Is there an easy way to do this?

Thanks,

Ryan
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi Ryan

In case those characters may appear elsewhere in your cell values, you could always use a formula such as:

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

and copy down. Then select the formulas and copy back over the originals as PasteSpecial>Values if required.
 
Upvote 0

Forum statistics

Threads
1,195,936
Messages
6,012,391
Members
441,695
Latest member
MickRobertson

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
Top