Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Althea
 
Posts: n/a
Default Splitting firstName from Surname


Hi
Forgotten how to split into separate columns. Have FirstName and Surname
together in one column (unfortunately some have a missle initial).
Want surname in separate column.
Tried Text to columns, but inital letter messes up the split.
Help??
Thanks
Althea


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mrice
 
Posts: n/a
Default Splitting firstName from Surname


For the first name you can use

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

For the surname, a new user defined function can be used.

(Select Surname from user defined list after pasting the following to a
VBA module)


Function Surname(Cell)
For M = Len(Cell) To 1 Step -1
If Mid(Cell, M, 1) < " " Then
Surname = Mid(Cell, M, 1) & Surname
Else
Exit For
End If
Next M
End Function


--
mrice

Reserach Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=535353

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Splitting firstName from Surname

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

and

=MID(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
",""))))+1,255)


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Althea" wrote in message
...

Hi
Forgotten how to split into separate columns. Have FirstName and Surname
together in one column (unfortunately some have a missle initial).
Want surname in separate column.
Tried Text to columns, but inital letter messes up the split.
Help??
Thanks
Althea




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Splitting firstName from Surname


You could use this formula for surname

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=535353

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
via135
 
Posts: n/a
Default Splitting firstName from Surname


hi!

try this!

in B1: =LEFT(A1,FIND(" ",A1,1))

assuming that the firstname & surname together in A1

-via135

Althea Wrote:
Hi
Forgotten how to split into separate columns. Have FirstName and
Surname
together in one column (unfortunately some have a missle initial).
Want surname in separate column.
Tried Text to columns, but inital letter messes up the split.
Help??
Thanks
Althea



--
via135
------------------------------------------------------------------------
via135's Profile: http://www.excelforum.com/member.php...o&userid=26725
View this thread: http://www.excelforum.com/showthread...hreadid=535353



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Althea
 
Posts: n/a
Default Splitting firstName from Surname




You could use this formula for surname

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))


Many thanks for all the different suggestions, problem solved
Thanks
Althea


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
excel to recog a surname, + paste address associated in new cell bacy Excel Discussion (Misc queries) 1 April 12th 06 05:39 AM
Text Splitting easier? (Tokeniser?) Lee Harris Excel Worksheet Functions 6 October 23rd 05 05:08 AM
Splitting a Target Figure oldgit99 Excel Worksheet Functions 3 August 23rd 05 02:50 PM
Extracting Surname from within a text string Iainkerr01 Excel Worksheet Functions 6 March 14th 05 10:16 AM
Splitting a cell, with a twist! christinab Excel Discussion (Misc queries) 8 March 4th 05 11:45 AM


All times are GMT +1. The time now is 02:26 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"