Copy String to the Right of "hyphen"

G

Guest

I have a column of data that includes a product name along with a code for a
particular container type. The name and code are separated by a hyphen. For
example AB1222-10, AB1222-330OW, AB1222-330OWPCFL.

As you can see, the string to the right of the hyphen varies in length and
it can be either alpha, numeric, or a mix.

How can I generate a column that contains only the text to the right of the
hyphen? Example (based on above): 10, 330OW, 330OWPCFL as cell values in
the column.

Thank you....
 
D

Dave Peterson

One way:
=RIGHT(A1,LEN(A1)-SEARCH("-",A1))

another if that stuff to the right is less than 255 characters:
=MID(A1,SEARCH("-",A1)+1,255)
 
G

Gord Dibben

Data>Text to Columns>Delimited by "Other" which is a hyphen.

At third step, choose to skip left-most column.


Gord Dibben MS Excel MVP
 

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