#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default text to columns

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Text from 2 Columns into 1 then Deleting the 2 Columns sleepindogg Excel Worksheet Functions 5 September 19th 08 12:36 AM
help with sorting text in columns to match other columns rkat Excel Discussion (Misc queries) 1 August 11th 06 03:42 AM
merge text from 2 columns into 1 then delete the old 2 columns sleepindogg Excel Worksheet Functions 4 March 30th 06 07:25 PM
Excel is automatically doing "text to columns" upon paste text. robert10000 Excel Discussion (Misc queries) 1 June 15th 05 07:49 PM
Linking text columns with text and data columns Edd Excel Worksheet Functions 0 March 17th 05 04:23 PM


All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"