+ Reply to Thread
Results 1 to 6 of 6

How do I sort based upon values in another column?

  1. #1
    Registered User
    Join Date
    10-26-2010
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    3

    Question How do I sort based upon values in another column?

    I have columns A thru L filled with data and column N contains a sorted list. The values in column N match those in A, however, the sort order is different.

    With that being said, I'd like to sort column A (and it's corresponding data in columns B-L) based upon the sort order seen in column N. Any idea how to do that?

    PS: I'm using Mac Office 2008.

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    Pro 2019
    Posts
    16,210

    Re: How do I sort based upon values in another column?

    Are the items in column N truly sorted? Just select columns A-L then sort them by the content of column A the same way you sorted N.

    If column N is just in some arbitrary order that you can't recreate with a sort, then you need to mirror columns B-L using VLOOKUP with column N as the search value.
    Making the world a better place one fret at a time | | |會 |會 |會 |會 | |:| | |會 |會
    Please read the rules
    If someone helped you, click on the star icon at the bottom of their post
    If your problem is solved, go to Thread Tools and select Mark This Thread Solved
    Don't attach a screenshot--just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.

  3. #3
    Registered User
    Join Date
    10-26-2010
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: How do I sort based upon values in another column?

    Column A is list of basketball players and they're sorted based upon their output from 2010. Column N is sorted based upon their projected output for 2011.

    How would I sort Column A to match the sort order found in Column N? What is the syntax?

  4. #4
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    Pro 2019
    Posts
    16,210

    Re: How do I sort based upon values in another column?

    If you have headers in your data on row 1, put the following formula in O2:


    =VLOOKUP($N2,A:L,COLUMN()-COLUMN($O$1)+2,FALSE)


    This will take the player's name in column N, find it in column A, then return the corresponding value in column B. If you fill this formula to the right to column Z, and down for as many rows of data you have, you will now have in columns O-Z all the values from columns A-L that correspond to the players in column N.


    If that doesn't seem to be what you want, attach your workbook and we'll have a look.

  5. #5
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    Pro 2019
    Posts
    16,210

    Re: How do I sort based upon values in another column?

    There is an error in that formula. Use this:

    =VLOOKUP($N2,$A:$L,COLUMN()-COLUMN($O$1)+2,FALSE)

  6. #6
    Registered User
    Join Date
    10-26-2010
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: How do I sort based upon values in another column?

    Thanks! This worked perfectly!

+ 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