+ Reply to Thread
Results 1 to 5 of 5

Sorting by second word in each cell?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2016
    Posts
    67

    Sorting by second word in each cell?

    I have a column of names, each with first and last. Instead of editing each cell to manually add a last name column (hundreds of names) beside the first, is there a way to sort using the second word of the column?

    Name
    John Thompson

    Is there any way to sort for the first character following a space, or something like that? Just hoping there's some way I can do this without grunting through each cell for almost a thousand Thanks for any help!!

  2. #2
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Sorting by second word in each cell?

    Do you not want the two names separated or do you believe it would be too much work to separate them?

  3. #3
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Sorting by second word in each cell?

    If you are able to have another column try this. If your names are in column A, place this code in B1 and drag down to all of the cells you need it in. This will give you the last name in each cell. You can hide this column so it is not showing and when you go to sort, simply choose "sort by column B".

    =IFERROR(LEFT(A1,FIND(" ",A1)-1),"")
    EDIT: Corrected my formula.
    Last edited by Teblol; 02-05-2016 at 03:38 PM.

  4. #4
    Registered User
    Join Date
    08-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2016
    Posts
    67

    Re: Sorting by second word in each cell?

    I would love to separate the two names, if some automated mechanism makes that possible. Really don't want to spend hours doing it manually.

    Thank you for that formula, but it gives the first name I tried changing the "LEFT" to "RIGHT" and tinkering with the "-1" but each cell is clipping the name differently

  5. #5
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Sorting by second word in each cell?

    Wow, I even went back to correct it and I still messed it up. If you want to place the first name into its own column and last name into its own column, you can use the original formula I gave you in column B and the column below in column C.

    =IFERROR(MID(A1,FIND(" ",A1),LEN(A1))," ")
    EDIT: Or you can just use DATA > Text to columns > Make sure delimited is selected and click "Next" > Make sure Space is selected and choose "Finish".
    This will move the last names to the next column.
    Last edited by Teblol; 02-05-2016 at 04:02 PM.

+ 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. Check cell for word, If word exists in cell, assign that cell to corresponding category.
    By Trevasaurus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 12:35 PM
  2. [SOLVED] How can I replace a word from a sentence in a cell & substitute word from another cell
    By rionoah in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-11-2012, 08:44 AM
  3. Replies: 7
    Last Post: 04-25-2011, 04:33 PM
  4. Replies: 3
    Last Post: 12-22-2009, 07:33 PM
  5. Sorting column by last word (name)
    By braenz in forum Excel General
    Replies: 3
    Last Post: 09-09-2008, 04:27 AM
  6. Linking a Word Table into Excel and sorting it
    By ETF in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2007, 09:07 PM
  7. [SOLVED] Excel Pivot Tables not sorting the word SUN properly
    By natheem in forum Excel General
    Replies: 2
    Last Post: 02-07-2005, 07:06 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