+ Reply to Thread
Results 1 to 10 of 10

Last name, first name - change to first name last initial

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    MA
    MS-Off Ver
    Excel 2009
    Posts
    27

    Post Last name, first name - change to first name last initial

    Hey guys,

    I've been trying to figure out how to change the order of a list of names.
    A2-A4
    Doe, John
    Frost, Jack
    Clause, Santa

    I want B2-B4 to say
    John D
    Jack F
    Santa C

    I've only managed to get "D John"
    =LEFT(A2)&" "&RIGHT(A2,LEN(A2)-FIND("*",SUBSTITUTE(A2," ","*",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))

    What am I forgetting?
    Brizzle
    Last edited by BRIZZLE101; 03-30-2013 at 04:43 PM.

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,658

    Re: Last name, first name - change to first name last initial

    Switch the "left" and "Right" formula
    =RIGHT(A2,LEN(A2)-FIND("*",SUBSTITUTE(A2," ","*",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))&" "&LEFT(A2)
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,717

    Re: Last name, first name - change to first name last initial

    For your examples this will work

    =MID(A2,FIND(",",A2)+2,99)&" "&LEFT(A2)
    Audere est facere

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Last name, first name - change to first name last initial

    slightly shorter...
    =RIGHT(A1,LEN(A1)-SEARCH(" ",A1,1))&" "&LEFT(A1,1)

    well la te da DDL lol
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    01-23-2013
    Location
    MA
    MS-Off Ver
    Excel 2009
    Posts
    27

    Re: Last name, first name - change to first name last initial

    thanks guys! They all worked!

  6. #6
    Registered User
    Join Date
    01-23-2013
    Location
    MA
    MS-Off Ver
    Excel 2009
    Posts
    27

    Re: Last name, first name - change to first name last initial

    Additionally, what would be done if there were two Mary P's? could the previous formulas be edited to add a second, or third letter of the last name for names that have the some of the same letters in the last name?

    Mary Pa
    Mary Po

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Last name, first name - change to first name last initial

    Use this inthe 2nd cell down, and copy down...
    =RIGHT(A2,LEN(A2)-SEARCH(" ",A2,1))&" "&LEFT(A2,IF(COUNTIF($B$1:B1,RIGHT(A2,LEN(A2)-SEARCH(" ",A2,1))&" "&LEFT(A2,1))>0,2,1)*1)

  8. #8
    Registered User
    Join Date
    01-23-2013
    Location
    MA
    MS-Off Ver
    Excel 2009
    Posts
    27

    Re: Last name, first name - change to first name last initial

    FDibbins,
    that doesn't seem to work. It is still producing first name last: 'Mary P'

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Last name, first name - change to first name last initial

    I had these names in A1:A4

    Doe, John
    Frost, Jack
    Clause, Santa
    Fall, Jack

    Then in B1, i had this...
    =RIGHT(A1,LEN(A1)-SEARCH(" ",A1,1))&" "&LEFT(A1,1)..........John D
    then in B2, copied down, I used this...
    =RIGHT(A2,LEN(A2)-SEARCH(" ",A2,1))&" "&LEFT(A2,IF(COUNTIF($E$1:E1,RIGHT(A2,LEN(A2)-SEARCH(" ",A2,1))&" "&LEFT(A2,1))>0,2,1)*1)

    I ended up with...
    HTML Code: 

  10. #10
    Registered User
    Join Date
    01-23-2013
    Location
    MA
    MS-Off Ver
    Excel 2009
    Posts
    27

    Re: Last name, first name - change to first name last initial

    Thanks I used B2 in B1.

+ 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