+ Reply to Thread
Results 1 to 12 of 12

Reformatting names with special characters from LastName, FirstName MiddleInitial

  1. #1
    Registered User
    Join Date
    09-08-2023
    Location
    Arizona
    MS-Off Ver
    Microsoft 365 Apps for Enterprise
    Posts
    5

    Reformatting names with special characters from LastName, FirstName MiddleInitial

    Hi all! New to the forum, so please be gentle.
    I've been working on this formula for over a week now, and I think I'm at the point where as I look at it to try and insert another function, nothing makes sense. It's all a jumble to me.

    What I have is in Column A (with a header):
    "Jones, Bob R"
    "Smith, Sally A"
    (and so on)

    What I need as an output:
    Bob Jones
    Sally Smith

    What I've gotten to so far:
    Bob R " " Jones
    Sally A " " Smith

    with the following:
    =IF((ISERROR(TRIM(MID(LEFT(A2&" ",SEARCH(" ? ",A2&" A ")),SEARCH(",",A2)+1,99)&LEFT(A2,SEARCH(",",A2)-1))))," ",(TRIM(MID(LEFT(A2&" ",SEARCH(" ? ",A2&" A ")),SEARCH(",",A2)+1,99)&LEFT(A2,SEARCH(",",A2)-1))))

    I need the outputs to be blank in the instance that column A does not have any data in it.

    Is there a better way to be doing this?
    Thanks in advance!

    ETA - File with examples - it's literally only what's above.
    Attached Files Attached Files
    Last edited by chellschaos; 09-08-2023 at 11:52 AM. Reason: Adding example file

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,435

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    For those two examples try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    One way (of many):

    =LET(A,TEXTSPLIT(TEXTBEFORE(A1&" "," ",2),", "),IFERROR(TEXTJOIN(" ",,CHOOSECOLS(A,2,1)),""))

    copied down

    or, a dynamic array

    =BYROW(A1:A4,LAMBDA(x,LET(A,TEXTSPLIT(TEXTBEFORE(x&" "," ",2),", "),IFERROR(TEXTJOIN(" ",,CHOOSECOLS(A,2,1)),""))))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Registered User
    Join Date
    09-08-2023
    Location
    Arizona
    MS-Off Ver
    Microsoft 365 Apps for Enterprise
    Posts
    5

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    Thank you so much for the quick response! I added the file (it's just the 2 lines I listed) for additional context. Your formula helps, but doesn't remove both instances of the " mark that surround the name.

  6. #6
    Registered User
    Join Date
    09-08-2023
    Location
    Arizona
    MS-Off Ver
    Microsoft 365 Apps for Enterprise
    Posts
    5

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    Thank you so much for the quick reply, Glenn! I added the file (it's just the 2 lines I listed) for additional context if that might help.
    Your formulas help (the second one blew my mind a little if I'm honest), but neither remove both instances of the " mark that surround the name. I realized after the fact that it may have appeared that I was listing the name as it appeared with the quotations around it, but the source actually has them listed that way and so I've listed them as such in the example file.
    Is this a simple tweak to either of your formulas? Or does it complicate things further?

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    OK. Try it again.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-08-2023
    Location
    Arizona
    MS-Off Ver
    Microsoft 365 Apps for Enterprise
    Posts
    5

    Cool Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    Quote Originally Posted by Fluff13 View Post
    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That worked! Thank you so much!

  10. #10
    Registered User
    Join Date
    09-08-2023
    Location
    Arizona
    MS-Off Ver
    Microsoft 365 Apps for Enterprise
    Posts
    5

    Thumbs up Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    Quote Originally Posted by Glenn Kennedy View Post
    OK. Try it again.
    Above and beyond, Glenn! Thank you so very much!

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    Glad to help & thanks for the feedback.

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Reformatting names with special characters from LastName, FirstName MiddleInitial

    Likewise...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Changing Firstname Lastname to Lastname, Firstname
    By jm594 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-19-2021, 07:26 PM
  2. [SOLVED] Formula to get LastName FirstName from FistName LastName
    By rizmomin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-06-2019, 08:12 PM
  3. [SOLVED] Changing name orders FROM LastName, FirstName TO FirstName LastName
    By Excel N00b in forum Excel General
    Replies: 1
    Last Post: 09-12-2015, 11:34 AM
  4. Replies: 4
    Last Post: 12-02-2014, 04:21 PM
  5. Separate FirstName & FirstName from LastName
    By djw76 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-30-2014, 02:50 PM
  6. Replies: 6
    Last Post: 11-13-2012, 06:45 PM
  7. Replies: 9
    Last Post: 04-18-2012, 06:27 PM

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