+ Reply to Thread
Results 1 to 8 of 8

Weighted Lottery with Unique Output

  1. #1
    Registered User
    Join Date
    02-11-2021
    Location
    Colorado
    MS-Off Ver
    365 Business
    Posts
    4

    Weighted Lottery with Unique Output

    Hello!

    I'm trying to create a weighted lottery with no duplicates to supplement a waitlist for enrollment at a private school.

    The formula I'm currently using looks like this in the output column:

    =INDEX(A$2:A$9,COUNTIF(C$2:C$9,"<="&RAND())+1)

    This works well except for one problem - I need to ensure there are no duplicates in the output of random numbers.

    Thank you for your help on this!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Weighted Lottery with Unique Output

    Welcome to the forum.

    Please tell us your Office version in your forum profile as it may determine the solution offered.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-11-2021
    Location
    Colorado
    MS-Off Ver
    365 Business
    Posts
    4

    Re: Weighted Lottery with Unique Output

    Thank you for your suggestions and welcome, Ali!

    I've updated my Office version and attached my sample workbook to this post. If there is anything else I can do to make my question more clear or easily answerable, please let me know!

    Thank you again,

    Kiera

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Weighted Lottery with Unique Output

    Here’s one way with new 365 functions:

    =SORTBY(SEQUENCE(8),RANDARRAY(8))

    https://www.excelcampus.com/tips/lis...no-duplicates/

  5. #5
    Registered User
    Join Date
    02-11-2021
    Location
    Colorado
    MS-Off Ver
    365 Business
    Posts
    4

    Re: Weighted Lottery with Unique Output

    Thank you, Ali.

    Unfortunately, this formula doesn't seem to result in a sequence of numbers that has no duplicates that are simultaneously based on the weighted percentage as reflected in column B.

    Any ideas?

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Weighted Lottery with Unique Output

    You’ll need to explain your weightings.

  7. #7
    Registered User
    Join Date
    02-11-2021
    Location
    Colorado
    MS-Off Ver
    365 Business
    Posts
    4

    Re: Weighted Lottery with Unique Output

    Based on a family's status, I need to assign certain children a weight of 10%, 15% or 20% to increase their odds of being chosen. This weight is listed under column B, entitled Assigned %.

    I created my original sheet based on the information I found on this page:

    //exceljet.net/formula/random-number-weighted-probability

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,659

    Re: Weighted Lottery with Unique Output

    This is a low tech proposal that employs three helper columns which may be moved and/or hidden for aesthetic purposes.
    1. Column F produces a list with duplicates and is populated using the formula from the exceljet article: =INDEX(A$2:A$9,MATCH(RAND(),C$2:C$9))
    Note that the list formula may need to be copied down 100 rows or more to ensure the inclusion of all students.
    2. Column D gives the first occurrence of each student in the list and is populated using: =MATCH(A2,F$2:F101,0)
    3. Column E is populated using: =RANK.EQ(D2,D$2:D$9,1)
    4. Finally the list of distinct student names is given in column H using: =INDEX(A$2:A$9,MATCH(ROWS(A$1:A1),E$2:E$9,0))
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] 3 lottery to find out how long it has been since a lottery number hit
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-14-2020, 04:38 AM
  2. Help with returning unique values from a weighted list
    By Brizzle in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-20-2018, 09:50 AM
  3. Pick 3 unique numbers from range with weighted probability
    By touyets in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2017, 06:33 AM
  4. Weighted average in table with unique ID
    By Arthurico in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-22-2017, 10:05 AM
  5. Weighted Lottery
    By Willis in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-17-2016, 01:03 PM
  6. Replies: 6
    Last Post: 12-07-2014, 06:59 PM
  7. unique lists, sumproduct, weighted average
    By mattmuphy in forum Excel General
    Replies: 3
    Last Post: 04-23-2012, 04:00 PM

Tags for this Thread

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