left and right functions

  • Thread starter Thread starter hshayhorn
  • Start date Start date
H

hshayhorn

I have cells that contain statements like ASL- Auto Selection Logic. I need
to take that cell and break it into two cells. One cell would be ASL and hte
other would be Auto Selection Logic. There is no standard length of words or
characters so I need to key off of the - in the line. Also, some of the lines
have multiple - in them so I need to look for the first - from the left and
go from there.

Can anyone help me?
 
hshayhorn said:
I have cells that contain statements like ASL- Auto Selection Logic. I need
to take that cell and break it into two cells. One cell would be ASL and hte
other would be Auto Selection Logic. There is no standard length of words or
characters so I need to key off of the - in the line. Also, some of the lines
have multiple - in them so I need to look for the first - from the left and
go from there.

Can anyone help me?

=TRIM(LEFT(A1,FIND("-",A1)-1))
=TRIM(MID(A1,FIND("-",A1)+1,9999))
 
=LEFT(A1,FIND("-",A1)-1)

the above will return what's left of the first hyphen


=MID(A1,FIND("-",A1)+1,255)

will return what's to the right, if you have more than 255 character change
that accordingly

--


Regards,


Peo Sjoblom
 
if ASL- Auto Selection Logic is in cell a1...
ASL:
=trim(LEFT(A1,FIND("-",A1)-1))
Auto Selection Logic:
=trim(RIGHT(A1,LEN(A1) - FIND("-",A1)))
 

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

Back
Top