+ Reply to Thread
Results 1 to 5 of 5

Sorting two columns

  1. #1
    Registered User
    Join Date
    11-22-2017
    Location
    Coquitlam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Sorting two columns

    I have two columns one with Names and the other with scores. I would like to sort by the highest scores but have the associated Name alongside it's respective number. I provided an example below. thanks for your help!


    Unsorted Sorted

    Bill 55 Bob 66
    Bob 66 Bill 55
    Ben 23 Ben 23
    Mary 21 Mary 21
    Greg 5 Phil 9
    Phil 9 Greg 5

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Sorting two columns

    your example looks like you have four columns, one with Bill, one with 55, one with Bob and one with 66.
    I'm assuming you have it in two columns so if you have Bill in cell A2 and 55 in cell B2 and Bob in cell A3 and 66 in cell B3 etc. then apply a filter to the columns then use the sort descending for column B and column A will follow. If you don't want the filter to remain then after the sort is complete then remove the filter.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Sorting two columns

    If you want the sort to be done in 2 extra columns, you could use LARGE() for the number columns, then use INDEX/MATCH to pull in the relevant name. Could there be duplicate numbers in your list, and if so, how would you want that handled?
    If this is what you want, and dont know how to do it, let me know and we cam walk you through it.

    If, on the other hand, you want the list sorted in place, you can use the SORT option on the menu bar

    @ Sambo, I think the 2nd list is how the OP wants the data to look afterwards?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    11-22-2017
    Location
    Coquitlam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Sorting two columns

    First off sorry about the confusion with the second list... FDibbins is correct that's what I want it to look like. There is most likely going to be matching numbers so I would want those together. Not sure if I was very clear but I want to rank(sort) the players (name column) by the amount of goals (number column) when I do a sort for the Numbers it will sort that column but the name won't correspond to their number. Basically I want to produce a list with each players goal total in order of most goals. Hope that makes sense!

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Sorting two columns

    Then use the process I described in the 2nd paragraph of post#2. Apply a filter to the (likely) 1st row then click the down arrow and at the top of the dropdown box you'll see a down arrow and A:Z for ascending order and below that an up arrow and Z:A for descending order sort. Use Z:A and both columns should sort the way you want. You can also use the sort function on the home tab. Either should get you what you want.

+ 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] Sorting filtered Columns by 2 different columns Office 2010
    By meabrams in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-12-2015, 02:59 AM
  2. sorting columns based on row criteria, with variable number of columns
    By bardobhb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-02-2014, 04:02 PM
  3. Replies: 0
    Last Post: 05-15-2013, 09:18 AM
  4. Replies: 3
    Last Post: 06-09-2011, 05:58 AM
  5. sorting two columns and write the sorted values on two columns in a different sheet
    By virsojour in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-22-2010, 04:38 AM
  6. Sorting groups of columns to a related group of columns
    By fuadramsey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-15-2007, 07:56 PM
  7. Replies: 1
    Last Post: 08-10-2006, 10: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