+ Reply to Thread
Results 1 to 6 of 6

Sort List According to Order in Master List (formula)

  1. #1
    Registered User
    Join Date
    09-07-2011
    Location
    Sacramento
    MS-Off Ver
    Excel 2007
    Posts
    37

    Sort List According to Order in Master List (formula)

    I have an unsorted list that is a subset of a master list. Of the entries in the unsorted list, I'd like to sort the items according to the order in the master list. I would prefer to use formulas instead of macros (I know how to create a macro to accomplish this task). Thanks.

    SortByMaster.xlsx

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Sort List According to Order in Master List (formula)

    In D6 this: =MATCH(B6,$A$6:$A$14,0)
    In C6 this: =INDEX($A$6:$A$14,SMALL($D$6:$D$10,ROW(A1)))

    copy both down

  3. #3
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Riverside, CA
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Sort List According to Order in Master List (formula)

    Hi Filibuster,

    I'm not sure if you can sort a list with just a formula, you would need to use the sort feature in Excel. I hope I'm wrong and a guru can help, it would be interesting to see.

    EDIT - Nevermind, I stand corrected.
    Happy Excel'ing!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Sort List According to Order in Master List (formula)

    Insert a new column C and put this formula in C6:

    =MATCH(B6,A:A,0)

    then copy down - it gives the row number where the item in column B exists in the master list in column A. Then put this formula in D6:

    =INDEX(A:A,SMALL(C:C,ROWS(A$1:A1)))

    and copy that down.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    09-07-2011
    Location
    Sacramento
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Sort List According to Order in Master List (formula)

    Thanks for the quick reply. Both solutions work great.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Sort List According to Order in Master List (formula)

    You're welcome. Thanks for the 'star tap'.

+ 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