+ Reply to Thread
Results 1 to 4 of 4

Is this command doing what I think? =INDEX(B1:B10),RANK(C1,C1:C10))

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Is this command doing what I think? =INDEX(B1:B10),RANK(C1,C1:C10))

    =INDEX(B1:B10),RANK(C1,C1:C10))

    This is my formula. I found this online when looking for a way to create a sort of raffle draw spreadsheet, which would randomly choose a name out of a list like randomly picking a name out of a hat. In B1-B10 are a list of names, and in C1-C10 are a list of numbers created by the rand() command.

    Now I thought this list ranked all the names in B by the values in C, so that whatever Cell had the highest number in C column, it would find the adjacent name in B column and output that. However this isn't the case. So I'm not sure exactly what this formula is doing and whether or not it can be used for the raffle draw I'm trying to create as I worry it could actually be biased.

    Any help?

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Is this command doing what I think? =INDEX(B1:B10),RANK(C1,C1:C10))

    That formula can be used, when dragged down a column, to order the 10 B1:B10 values randomly without repetition.

    If you only want to pull a single name you don't really need =RAND() in column C you can just use RAND() in the formula, e.g.

    =INDEX(B1:B10,RAND()*10+1)
    Audere est facere

  3. #3
    Registered User
    Join Date
    06-08-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Is this command doing what I think? =INDEX(B1:B10),RANK(C1,C1:C10))

    Thanks for the quick reply.

    What if I have a list of more or less than 10 members? I in fact have it set up to be of variable size using another cell which will hold the total number of entrants. Say this value is in D1 will the formula become

    =INDEX(B1:B10,RAND()*D1+1)

    Would this work for more random amounts of entrants that aren't as round as 10.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Is this command doing what I think? =INDEX(B1:B10),RANK(C1,C1:C10))

    Yes, but you will need to have the names in the first n cells, e.g. if D1 is 7 then that formula will randomly return one of the names from B1:B7. If you want you can dispense with D1 and just use COUNTA to count the names, i.e.

    =INDEX(B1:B10,RAND()*COUNTA(B1:B10)+1)

    You can extend B1:B10 range to any size you want

+ 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