+ Reply to Thread
Results 1 to 7 of 7

Changing LastName, FirstName XX cell data to FirstName LastName XX

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    10

    Changing LastName, FirstName XX cell data to FirstName LastName XX

    Hey guys,

    I'm sorry if this has been answered before, but I wasn't able to find any that worked for this situation.

    I have about 4,000 names in column A that are currently in the format LastName, FirstName XX (XX stands in place of a two-character job title abbreviation, and as such is different from row to row; not how I would have done this, but it is what it is).

    I need to figure out a way to change these cells to FirstName LastName XX. It makes no difference to me if this is accomplished by initially splitting the data into individual columns and then reassembling, or if it's all done with a single command.

    To further complicate matters, there are more than a few entries in here with multiple first names (i.e., Smith, Mary Beth NP).

    I've found formulas in the forums that have gotten me fairly consistently to FirstName XX LastName, but can't get over the hump to the fully correct format.

    Any help you guys can offer would be greatly appreciated. I've been given a friendly challenge that I'll be unable to sort this out before the morning, and I'd really love to have it corrected and in their inbox by morning.

    Thanks again, everyone.

    Mike

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Changing LastName, FirstName XX cell data to FirstName LastName XX

    With
    A1: Public, John Q.

    To display the name as Firstname Lastname
    B1: =MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)
    or
    If extra spaces may be a problem:
    B1: =TRIM(MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1))

    Returns John Q. Public

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    07-14-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    10

    Re: Changing LastName, FirstName XX cell data to FirstName LastName XX

    Quote Originally Posted by Ron Coderre View Post
    With
    A1: Public, John Q.

    To display the name as Firstname Lastname
    B1: =MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)
    or
    If extra spaces may be a problem:
    B1: =TRIM(MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1))

    Returns John Q. Public

    Does that help?
    Ron,

    Thank you very much for your reply.

    This returns FirstName XX LastName, which is close, but not quite there.

    The XX isn't a middle initial, but a two-character job title abbreviation, and must remain at the end of the name, so the desired output is FirstName LastName XX.

    EDIT: So to clarify, with A1: Public, John NP, I'm looking for output John Public NP.

    Thank you again; I really do appreciate you giving me a hand with this.

    -Mike.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Changing LastName, FirstName XX cell data to FirstName LastName XX

    I just re-read your post and saw something I missed the first time.

    With
    A1: Public, John Q. XX

    To display the name as Firstname Lastname XX
    try this:
    Please Login or Register  to view this content.
    In the above example, the formula returns: John Q. Public XX

    Does that hep?
    Last edited by Ron Coderre; 07-14-2010 at 09:30 PM.

  5. #5
    Registered User
    Join Date
    07-14-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    10

    Re: Changing LastName, FirstName XX cell data to FirstName LastName XX

    Quote Originally Posted by Ron Coderre View Post
    I just re-read your post and saw something I missed the first time.

    With
    A1: Public, John Q. XX

    To display the name as Firstname Lastname XX
    try this:
    Please Login or Register  to view this content.
    In the above example, the formula returns: John Q. Public XX

    Does that hep?

    Ron,

    This worked absolutely perfectly. I was expecting to need to manually rearrange those entries with multiple first names, but your code even parsed those correctly.

    I can't tell you how much I appreciate you taking the time to help me with this; I'm extremely grateful.

    -Mike.

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Changing LastName, FirstName XX cell data to FirstName LastName XX

    You're very welcome...I'm glad I could help.

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    Colorado Springs, CO USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Changing LastName, FirstName XX cell data to FirstName LastName XX

    This worked perfectly, once I realized B5 was looking for data in A1. What a great time saver and it made me look like a real smart guy....someday I will tell the truth but the HR gal thought "cheeky forum moderator" was downright decent. Thanks for all you do.

+ 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