Removing text from cells

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

Hi,

I have a spreadsheet with a list of reference numbers in
column A. The numbers are like this.

AAA/12345/Smith J Mr

What I want to do is remove the text after the last / eg.
Smith J Mr.

I have thousands of cells I need to remove this on.

Please help.

Thanks.
 
Hi Craig

are all the entries the same number of characters for the first two
sections,
AAA/12345/
BBB/67890/
etc

if so you can do this using a "helper" column - in column B type
==LEFT(A1,10)
and then double click on the fill handle (bottom right hand side of cell) to
fill down
now copy column B
click on A1 and choose Edit / Paste Special Values
and then you can delete column B

(however, before trying this please take a backup of your workbook).

please let us know how you go

cheers
JulieD
 
Hi
you may try the following formula for this:
=LEFT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"/","^^",LEN
(A1)-LEN(SUBSTITUTE(A1,"/","")))))
 
Thanks Frank,

Your formula has partialy worked but what did'nt mention
in my fist post and probably should have is the all the
references are not like the examle. Here are some
references exactly as I have them.

IEMK/CLG/108226/Grounds Cliffo
JC/cnm/101272/StockHMr
GJH/KHF/SB/78366
RJ/120849
FB/KM/42746/Croxall

Yor formula only shows so many digits eg. IEMK/CLG/10822
appeared for the top reference of the list above.

Any Ideas?
 
Hi
sorry, made a mistake. Try
=LEFT(A1,SEARCH("^^",SUBSTITUTE(A1,"/","^^",LEN(A1)-LEN
(SUBSTITUTE(A1,"/","")))))

this returns
IEMK/CLG/108226/

for your first example
 
Frank Kabel said:
sorry, made a mistake. Try
=LEFT(A1,SEARCH("^^",SUBSTITUTE(A1,"/","^^",LEN(A1)
-LEN(SUBSTITUTE(A1,"/","")))))

this returns
IEMK/CLG/108226/

for your first example

Yes, but your formula above returns

GJH/KHF/SB/
RJ/

for the 3rd and 4th sample lines. Maybe that's what the OP wants. If not,
and if those records should flow through as-is (as well as records
containing no slashes at all), then there's the array formula

=IF(OR(ISNUMBER(-RIGHT(A1,1)),COUNTIF(A1,"*/*")=0),A1,
LEFT(A1,MATCH(2,1/(MID(A1,ROW(INDIRECT("1:1024")),1)="/"))))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Copying Text Cells 4
sort help 9
Remove initial from end of name 8
Formatting within formulas 3
Text to Columns help 8
Extract parts of a cell 6
delete middle word from a cell 5
Removing text 5

Back
Top