+ Reply to Thread
Results 1 to 5 of 5

First Name Last Name to Last Name First Name

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    First Name Last Name to Last Name First Name

    Hello:

    I have name as First Name Middle Initial Last Name (Example John E Doe)
    How would i convert it as Last Name, First Name Middle Initial ( Result as Doe, John E)

    Please help and let me know if any questions.

    Thank you

    Riz Momin
    Last edited by rizmomin; 06-13-2013 at 12:32 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: First Name Last Name to Last Name First Name

    =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",20)),20))&", "&TRIM(LEFT(SUBSTITUTE(A1," ",REPT(" ",20)),40)) would do it
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: First Name Last Name to Last Name First Name

    Hi Martinwilson:

    Thanks a lot, it works.

    Riz Momin

  4. #4
    Registered User
    Join Date
    04-28-2013
    Location
    Poznań/Poland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: First Name Last Name to Last Name First Name

    Hello,

    =right(B30;DŁ(B30)-find("*";substitute(B30;" ";"*";len(B30)-len(substitute(B30;" ";"")));1))&", "&substitute(B30;right(B30;DŁ(B30)-find("*";substitute(B30;" ";"*";len(B30)-len(substitute(B30;" ";"")));1));"")

    Regards

  5. #5
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: First Name Last Name to Last Name First Name

    This works for John E Doe and John Doe

    =(IF((IF((LEN(A1)-LEN(SUBSTITUTE(A1," ","")))>1,FIND(" ",A1,(FIND(" ",A1,1))+1),""))<>"",RIGHT(A1,LEN(A1)-(IF((LEN(A1)-LEN(SUBSTITUTE(A1," ","")))>1,FIND(" ",A1,(FIND(" ",A1,1))+1),""))),RIGHT(A1,LEN(A1)-(FIND(" ",A1,1))))) & ", " & (IF((LEN(A1)-LEN(SUBSTITUTE(A1," ","")))>1,MID(A1,(FIND(" ",A1,1))+1,(IF((LEN(A1)-LEN(SUBSTITUTE(A1," ","")))>1,FIND(" ",A1,(FIND(" ",A1,1))+1),""))-(FIND(" ",A1,1))),"")) & " " & (LEFT(A1,(FIND(" ",A1,1))-1))
    Elegant Simplicity............. Not Always

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1