+ Reply to Thread
Results 1 to 6 of 6

Sort Text in a cell from A-Z

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    Lisbon
    MS-Off Ver
    Excel 2007
    Posts
    3

    Sort Text in a cell from A-Z

    Hi

    I have a list of employes and I want to sort not by first name but by last name and I don't want to rewrite it all.

    can you please help to sort by the last word in the cell?

    thank you

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Sort Text in a cell from A-Z

    Assume the names are in column A starting with cell A1:
    - Add a column to the right ie column B
    - Add this formula to cell B1 and copy down: =RIGHT(A1,LEN(A1)-FIND(" ",A1))
    - Column B now contains the last name
    - Sort columns A and B using Column B as the sort by criteria

    If you don't need it, after sorting you can delete column B
    Last edited by K m; 10-09-2012 at 09:08 AM.
    Click on star (*) below if this helps

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    Lisbon
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sort Text in a cell from A-Z

    it doesn't work , it displays an error in the formula

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Sort Text in a cell from A-Z

    It works for me. Here is a sample file
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-26-2012
    Location
    Lisbon
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sort Text in a cell from A-Z

    OK I see the problem I have more than two names in a cell (4 or 5), and I just want the last one.

  6. #6
    Registered User
    Join Date
    03-07-2012
    Location
    Fiji
    MS-Off Ver
    Microsoft 365
    Posts
    23

    Re: Sort Text in a cell from A-Z

    Quote Originally Posted by SophiaBB View Post
    OK I see the problem I have more than two names in a cell (4 or 5), and I just want the last one.
    Following K m's instructions above, just change the formula to the below. Should work fine.

    =RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1," ","*",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))

+ 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