Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Alice
 
Posts: n/a
Default FIND or LEFT or MID to swap first name with last name?

Not sure how the formula should read to swap first name with last name in a
sheet. All names were entered using First name, Middle initial and Last
name. Sometimes Middle name is used rather than initial. Not sure how to
designate position of Last name. Thanks.
--
Alice.
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

One way:

=RIGHT(A1,MATCH(" ",MID(A1,1+LEN(A1)-ROW(INDIRECT("1:"&LEN
(A1))),1),0)-1)&" "&LEFT(A1,FIND(" ",A1,FIND(" ",A1)+1))

Press ctrl/shift/enter, not just enter.

HTH
Jason
Atlanta, GA

-----Original Message-----
Not sure how the formula should read to swap first name

with last name in a
sheet. All names were entered using First name, Middle

initial and Last
name. Sometimes Middle name is used rather than

initial. Not sure how to
designate position of Last name. Thanks.
--
Alice.
.

  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

Assuming there is a space before the last name you can use this

=RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))&",
"&SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))),"")


note that I added a comma this part &", "&, if you don't want that use

=RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))&"
"&SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))),"")


it will fail for last name plus JR and II etc but those are probably quite
few and can be done with manually



Regards,

Peo Sjoblom


"Alice" wrote:

Not sure how the formula should read to swap first name with last name in a
sheet. All names were entered using First name, Middle initial and Last
name. Sometimes Middle name is used rather than initial. Not sure how to
designate position of Last name. Thanks.
--
Alice.

  #4   Report Post  
Alice
 
Posts: n/a
Default

Thank you both. Peo's formula works great! I will try Jason's as well.

alice.


"Peo Sjoblom" wrote:

Assuming there is a space before the last name you can use this

=RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))&",
"&SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))),"")


note that I added a comma this part &", "&, if you don't want that use

=RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))&"
"&SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))),"")


it will fail for last name plus JR and II etc but those are probably quite
few and can be done with manually



Regards,

Peo Sjoblom


"Alice" wrote:

Not sure how the formula should read to swap first name with last name in a
sheet. All names were entered using First name, Middle initial and Last
name. Sometimes Middle name is used rather than initial. Not sure how to
designate position of Last name. Thanks.
--
Alice.

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
How do I compare data in two worksheets to find matching cells? Gary Excel Discussion (Misc queries) 4 March 2nd 06 10:04 PM
Excel has a "Find Next" command but no "Find Previous" command. Michael Fitzpatrick Excel Discussion (Misc queries) 2 January 11th 05 12:45 AM
Find & Replace results to display specified chosen fields samuel Excel Discussion (Misc queries) 1 December 28th 04 09:43 AM
Find Fn from right? mikelee101 Excel Worksheet Functions 3 December 21st 04 06:53 PM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 06:45 PM


All times are GMT +1. The time now is 02:52 AM.

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"