Forum Discussion

Joshua655's avatar
Joshua655
Copper Contributor
Dec 08, 2023
Solved

Need reccomendations for building a ticket puller for a raffle with Excel.

I have very little understanding in excel so I will go through what i have tried so far.

I need my sheet to output 3 different names weighted by ticket amount. I have tried using a =lookup combined with a =rand() but it did not quite work like I had wanted. The function I was attempting to use to select winners is =LOOKUP(J3,G4:G9,B4:B9) where the G cells are the Cumulative Weight, J3 is a =RAND() output and B cells are the name of the winner. I have 2 very critical issues.
1) The way I have done this Cory has a much, much higher likelihood to win in the example table given the way that =RAND() functions and the lookup works with the Cumulative Weight and Garret would never be pulled no matter how many tickets he has given that his cumulative total would always be 1.

2) I would prefer a way to have a name drawn only once from the table but I can also just do that manually if I can solve issues and actually get the table to function correctly.
I do not have a good enough grasp of Excel to know how to fix this and make the table function as intended. Below is a sample of what my data table is currently outputting with the sample inputs.

Ticket HolderDonation AmountRate 500-1Ticket Total:544Weight%Cumulative Weight Winners0.701570.273630.84860
Luke2000 40.0073530.007353 Grand Prize!   
Jack20000 400.0735290.080882 Cory   
Sarah10000 200.0367650.117647 Second Prize!   
Cory30000 600.1102940.227941 Cory   
Laura200000 4000.7352940.963235 Third Prize!   
Garret10000 200.0367651.000000 Cory   
  • Joshua655 You were very close, instead of LOOKUP, it's better to use XLOOKUP where we can define the match mode to be "Next larger". Your formula should look like this:

     

     

    =XLOOKUP(RAND(),E2:E7,A2:A7,,1)

     

     

    To make sure each participant can only win one prize, we have to filter the existing dataset as following:

     

     

    =FILTER(A2:C7,A2:A7<>G2)

     

     

    I made a custom video for you, explaining how to build the raffle system step-by-step: https://www.youtube.com/watch?v=gjT_92KZy-E

     

    Optional tip if this was helpful: [link removed by admin]

1 Reply

  • Joshua655 You were very close, instead of LOOKUP, it's better to use XLOOKUP where we can define the match mode to be "Next larger". Your formula should look like this:

     

     

    =XLOOKUP(RAND(),E2:E7,A2:A7,,1)

     

     

    To make sure each participant can only win one prize, we have to filter the existing dataset as following:

     

     

    =FILTER(A2:C7,A2:A7<>G2)

     

     

    I made a custom video for you, explaining how to build the raffle system step-by-step: https://www.youtube.com/watch?v=gjT_92KZy-E

     

    Optional tip if this was helpful: [link removed by admin]

Resources