+ Reply to Thread
Results 1 to 12 of 12

Formula to reverse Last Name and First Name

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    cayman islands
    MS-Off Ver
    Excel 2003
    Posts
    17

    Formula to reverse Last Name and First Name

    Please how do i do the following

    column a has a list of names in it - last name, first name

    is there a way to reverse that to read - first name, last name

    with out having to re type all names

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Column sorting

    If there are only ever two names separated by a space then one way would be

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


    However I can't help thinking that all the names may not be a simple first/last name, in which case we need to see a representative sample of your data.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-15-2014
    Location
    cayman islands
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Column sorting

    MR. bUTTREY THANKS THAT DIDNT HELP I HAVE ATTACHED A SAMPLE
    Attached Files Attached Files

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Formula to reverse Last Name and First Name

    @Richards solution works with the adaption to accomodate ','


    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Formula to reverse Last Name and First Name

    You might need to either add a -1 to the formula or wrap in a Trim

    =RIGHT(A2,LEN(A2)-FIND(",",A2)-1)&" "&LEFT(A2,FIND(",",A2)-1)

    =TRIM(RIGHT(A2,LEN(A2)-FIND(",",A2))&" "&LEFT(A2,FIND(",",A2)-1))
    HTH
    Regards, Jeff

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula to reverse Last Name and First Name

    Aesthetically speaking..

    =TRIM(RIGHT(SUBSTITUTE(A2,",",REPT(" ",255)),255))&" "&TRIM(LEFT(SUBSTITUTE(A2,",",REPT(" ",255)),255))


    or

    TRIM(RIGHT(SUBSTITUTE(A2,",",REPT(" ",255)),255)&" "&LEFT(SUBSTITUTE(A2,",",REPT(" ",255)),255))


    Life's a spreadsheet, Excel!
    Say thanks, Click *

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Formula to reverse Last Name and First Name

    Or try:

    =MID(A2&" "&A2,FIND(",",A2)+2,LEN(A2)-1)

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Formula to reverse Last Name and First Name

    Another way:

    =TRIM(MID(SUBSTITUTE(A2&" "&A2,",",REPT(" ",255)),255,255))

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Formula to reverse Last Name and First Name

    An alternative solution if you are using Excel 2010 or later is Power Query. Here is the Mcode and the document

    Please Login or Register  to view this content.
    Since you posted an .xlsx file, I can assume you are no longer using Excel 2003 as indicated in your profile. Please update your profile to the correct version of excel. This is important as solution may vary based upon the version you are using.
    Attached Files Attached Files
    Last edited by alansidman; 01-01-2020 at 10:28 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  10. #10
    Registered User
    Join Date
    04-15-2014
    Location
    cayman islands
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Formula to reverse Last Name and First Name

    Thanks all got it to work

    happy new year all the best for 2020

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Formula to reverse Last Name and First Name

    Glad to see these solutions worked for you. You're very welcome. We are happy to help and thanks for the feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Formula to reverse Last Name and First Name

    The other pragmatic solution would have been to use TextToColumns specifiying the comma as a delimiter then in column C concatenate the names with
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. [SOLVED] VBA problem - reverse an alphanumeric string, but reverse only letters and leave digits wh
    By mati_WAR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-18-2019, 10:39 PM
  2. Replies: 7
    Last Post: 11-27-2018, 08:02 PM
  3. Can you reverse this formula?
    By Jimmy1996 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2016, 10:21 PM
  4. How to reverse a formula?
    By Fred45 in forum Excel General
    Replies: 1
    Last Post: 07-31-2015, 11:00 AM
  5. [SOLVED] Reverse formula
    By yeritson in forum Excel General
    Replies: 3
    Last Post: 05-04-2015, 10:08 AM
  6. [SOLVED] Reverse strings udf function to reverse numbers
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2015, 07:03 AM
  7. How to reverse this formula?
    By mumbles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2006, 06:50 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