+ Reply to Thread
Results 1 to 3 of 3

sort a portion of a list of cells based on a variable

  1. #1
    Registered User
    Join Date
    02-07-2014
    Location
    Little Elm, Tex
    MS-Off Ver
    Excel 2010
    Posts
    7

    sort a portion of a list of cells based on a variable

    I have a list of names/indexes, along with a random number used for sorting....depending on the number of names, we'll divide them into flights. So I want to be able to sort the first X names based on the random seed (column C). Then sort the next X names based on the random seed, etc., etc. depending on the value in G2.

    Example, if I have 40 names, 2 flights, I want the first 20 names sorted off the key in Col. C, then the next 20 names after that.

    In this way, the flights are randomly drawn so that pairings are done randomly

    Thanks for any help!
    Mark
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: sort a portion of a list of cells based on a variable

    See how next formula and macro can work
    The macro is preparing the random numbers in column D
    The formula gives the names in a random manner
    You have the set of names listed in a random way in column C
    C2=INDEX($A$2:$A$17,MATCH(SMALL($D$2:$D$17,ROWS($C$2:$C2)),$D$2:$D$17,0),1)
    Please Login or Register  to view this content.
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    02-07-2014
    Location
    Little Elm, Tex
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: sort a portion of a list of cells based on a variable

    I discovered a simpler way to handle this situation using random keys and sorting. Thank for the answer and to anyone that thought about this.

+ 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. How do I sort end portion of value numberically
    By lkevinc42036 in forum Excel General
    Replies: 4
    Last Post: 06-25-2012, 11:38 AM
  2. Sort based on multiple variable conditions
    By tstoney in forum Excel General
    Replies: 8
    Last Post: 03-14-2012, 06:37 PM
  3. Sort by a portion of a String
    By Stupidav in forum Excel General
    Replies: 3
    Last Post: 10-07-2010, 04:50 PM
  4. How to sort by day portion of date cells
    By jPaulB in forum Excel General
    Replies: 4
    Last Post: 10-21-2008, 04:08 AM
  5. Set variable sort range based on found text
    By jeffbert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2006, 05:20 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