Strip out text copy and paste?

  • Thread starter Mark Y via OfficeKB.com
  • Start date
M

Mark Y via OfficeKB.com

Hello all,

I have some text in cells A2 - A646 as below

Smith, John (LD)
Gummerson, Liz (SDLP)

The lengths of names are variable but first name is always seperated by a
comma and second name is followed by a space.

What I need to do, if possible, is to copy the first name into cell H2 and
second name into cell I2

Is there any straightforward way of doing this?

Many thanks in advance

Mark
www.familyfund.org.uk
 
J

JE McGimpsey

One way:

If the first name is always followed by a left paren, as well:

H2: =TRIM(MID(LEFT(A2,FIND("(",A2)-1),FIND(",",A2)+1,255))
I2: =LEFT(A2,FIND(",",A2)-1)
 
M

Mark Y via OfficeKB.com

WOW!!

Thats exactly what I needed and such a speedy reply! As per usual this forum
comes up number 1 again,

Thanks again!!

Mark :)
 

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

Top