Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am importing data from a database that describes hundreds of products that
we sell. Each product code has a suffix to indicate the container-type that it's sold in. The format for these data is "ABC1234-55" wherein the -55 indicates a 55 gallon drum. These suffixes vary from 2 digits to 7 digits in lenght; which means I cannot readily use the =RIGHT(cell, 2). Is there some version of the RIGHT command or some other means by which I can copy the contents of the cell that are to the right of the hyphen? For instance; Column A would have ABC12345-55 in (A1) and XYZ4444-999OW in (A2). I'd like to write a function that would paste 55 in (B1) and 999OW in (B2). Thanks.. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
One way:
=RIGHT(A1,LEN(A1)-FIND("-",A1)) HTH, Paul "ConfusedNHouston" wrote in message ... I am importing data from a database that describes hundreds of products that we sell. Each product code has a suffix to indicate the container-type that it's sold in. The format for these data is "ABC1234-55" wherein the -55 indicates a 55 gallon drum. These suffixes vary from 2 digits to 7 digits in lenght; which means I cannot readily use the =RIGHT(cell, 2). Is there some version of the RIGHT command or some other means by which I can copy the contents of the cell that are to the right of the hyphen? For instance; Column A would have ABC12345-55 in (A1) and XYZ4444-999OW in (A2). I'd like to write a function that would paste 55 in (B1) and 999OW in (B2). Thanks.. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try:
[B1] = RIGHT(A1,LEN(A1)-FIND("-",A1)) Bill ---------------- ConfusedNHouston wrote: I am importing data from a database that describes hundreds of products that we sell. Each product code has a suffix to indicate the container-type that it's sold in. The format for these data is "ABC1234-55" wherein the -55 indicates a 55 gallon drum. These suffixes vary from 2 digits to 7 digits in lenght; which means I cannot readily use the =RIGHT(cell, 2). Is there some version of the RIGHT command or some other means by which I can copy the contents of the cell that are to the right of the hyphen? For instance; Column A would have ABC12345-55 in (A1) and XYZ4444-999OW in (A2). I'd like to write a function that would paste 55 in (B1) and 999OW in (B2). Thanks.. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could also use the Text to Columns function in the Data menu. You can
specify it to split either in a standard spot or at a character (like a hyphen). I use this for pretty much the exact same thing you are doing and it works great. There's a good tutorial if you need more help. -- Greg "ConfusedNHouston" wrote: I am importing data from a database that describes hundreds of products that we sell. Each product code has a suffix to indicate the container-type that it's sold in. The format for these data is "ABC1234-55" wherein the -55 indicates a 55 gallon drum. These suffixes vary from 2 digits to 7 digits in lenght; which means I cannot readily use the =RIGHT(cell, 2). Is there some version of the RIGHT command or some other means by which I can copy the contents of the cell that are to the right of the hyphen? For instance; Column A would have ABC12345-55 in (A1) and XYZ4444-999OW in (A2). I'd like to write a function that would paste 55 in (B1) and 999OW in (B2). Thanks.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I copy an entire worksheet to another with text & format? | Excel Discussion (Misc queries) | |||
Copy a string text to cell if another cell not empty | Excel Discussion (Misc queries) | |||
Truncating text before a hyphen | Excel Worksheet Functions | |||
Find text in cell, copy row to new sheet | Excel Discussion (Misc queries) | |||
How to copy a formula as text to another cell? | Excel Discussion (Misc queries) |