Thread: text to columns
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default text to columns

This formula will display the text to the left of the first dash...

=LEFT(A1,FIND("-",A1&"-")-1)

And this formula will return all the text after that first dash...

=MID(A1,FIND("-",A1&"-")+1,99)

The second formula assumes your entries are not longer than 99 characters.
If they could be longer, just change the 99 to 999 instead. Oh, and these
formulas can be copied down as needed.

--
Rick (MVP - Excel)


"bwduncan" wrote in message
...
I've exported a worksheet that put are customer id # and name in the same
column.
Of course our customer id aren't all the same length and some of the names
also have a "-" in them. Is there a way to seperate this by the first
hyphen
only and to disregard the second one?