Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Chris Glen
 
Posts: n/a
Default Splitting text, like "Text to columns", but as a formula

I have first names and last names in one column that I want to split into two
columns. A formula woul be more practical than using the "Text to columns",
as I'm constantly adding to the spreadsheet, and need to rapidly get the one
column and two column versions out of it. I know LEFT and RIGHT work well for
fixed length situations, so I'm hoping there's similar comand that uses a
delimiter.
  #2   Report Post  
Posted to microsoft.public.excel.misc
CaptainQuattro
 
Posts: n/a
Default Splitting text, like "Text to columns", but as a formula


The following will work as long as don't have any middle names in your
mix:


In Cell A1 put the first and last name e.g.

Adam Crabapple

In Cell B1 enter formula =LEFT(A1,FIND(" ",A1)-1)

In Cell C1 enter =TRIM(MID(A1,FIND(" ",A1)+1,50))


--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: http://www.excelforum.com/member.php...o&userid=32763
View this thread: http://www.excelforum.com/showthread...hreadid=539165

  #3   Report Post  
Posted to microsoft.public.excel.misc
Chris Glen
 
Posts: n/a
Default Splitting text, like "Text to columns", but as a formula

Thanks - I don't understand how the forulae work, but they do work (obviously
the "50" in the end of the second one limits the length of text to 50
characters...

Cheers
Chris

"CaptainQuattro" wrote:


The following will work as long as don't have any middle names in your
mix:


In Cell A1 put the first and last name e.g.

Adam Crabapple

In Cell B1 enter formula =LEFT(A1,FIND(" ",A1)-1)

In Cell C1 enter =TRIM(MID(A1,FIND(" ",A1)+1,50))


--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: http://www.excelforum.com/member.php...o&userid=32763
View this thread: http://www.excelforum.com/showthread...hreadid=539165


  #4   Report Post  
Posted to microsoft.public.excel.misc
CaptainQuattro
 
Posts: n/a
Default Splitting text, like "Text to columns", but as a formula


You are right. 50 is an arbitrary number of characters, but the number
has to be big enough to accommodate the longest names that you might
have to parse.

It doesn't really matter how big the number is because the "=TRIM"
function eliminates all the blank spaces beyond the end of the name.


--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: http://www.excelforum.com/member.php...o&userid=32763
View this thread: http://www.excelforum.com/showthread...hreadid=539165

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
Formula Being treated as Text BBB Excel Worksheet Functions 2 September 20th 05 05:38 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Using the text from a cell as a range name in a formula Fletch Excel Discussion (Misc queries) 3 June 13th 05 07:57 PM
How to insert carriage return in the middle of a text formula to . Dave Excel Discussion (Misc queries) 2 March 17th 05 02:14 PM
Concatenation formula loses text wrap formatting DFM Excel Discussion (Misc queries) 5 December 27th 04 01:45 PM


All times are GMT +1. The time now is 08:45 AM.

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

About Us

"It's about Microsoft Excel"