ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copy String to the Right of "hyphen" (https://www.excelbanter.com/excel-discussion-misc-queries/86175-copy-string-right-hyphen.html)

ConfusedNHouston

Copy String to the Right of "hyphen"
 
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....

Ardus Petus

Copy String to the Right of "hyphen"
 
=MID(A3,FIND("-",A3)+1,1024)

HTH
--
AP

"ConfusedNHouston" a écrit dans
le message de news: ...
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....




Dave Peterson

Copy String to the Right of "hyphen"
 
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)




ConfusedNHouston wrote:

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....


--

Dave Peterson

Gord Dibben

Copy String to the Right of "hyphen"
 
DataText to ColumnsDelimited by "Other" which is a hyphen.

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


Gord Dibben MS Excel MVP

On Mon, 1 May 2006 09:02:02 -0700, ConfusedNHouston
wrote:

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....




All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com