Dynamically extend list help

tezza

Active Member
Joined
Sep 10, 2006
Messages
384
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
  2. Web
Hi,

I'm in the process of setting up a raffle generator and prize winner.

Step 1 : Enter Name and how many tickets they've bought

Step 2 : Create a dynamic list of names and tickets numbers depending on how many tickets are purchased per person

Step 3 : Allow someone to hit a button to generate the next winner without picking a duplicate number

It works, but I'm oddly looking struggling with making Step 2 dynamic.

Currently the formula I come across is:
Excel Formula:
=LET(x,FILTER(F2:F19,COUNTIF(H2:INDEX(H:H,COUNTA(H:H)),F2:F19)=0),INDEX(x,RANDBETWEEN(1,ROWS(x))))

The list is fixed at reading F2:F19.

How can I change it so F19 updates to include the full list of names? If I extend past the list range into blanks, then at some point, it will pick a blank due the the cell being empty.

Here's a visual of where I'm at (no frills until I can get this last bit sorted.

Col J will have a button in there to run the next winners code.

RAFFLE TICKET GENERATOR.xlsm
ABCDEFGHIJK
1NAMESPENDTICKETSLISTTICKET NUMBERRAFFLEWINNERNUMBER GENERATOR
2Alberto Holcomb£1.001Alberto Holcomb00010018Rosalinda Ruffin12
3Obed Rosales£2.002Obed Rosales00020011Jim Fontenot
4Roxanna Whatley£1.001Obed Rosales00030005Kinley Livingston
5Kinley Livingston£3.003Roxanna Whatley00040009Carlos Goss
6Carlos Goss£2.002Kinley Livingston00050003Obed Rosales
7Jim Fontenot£3.003Kinley Livingston00060014Juancarlos Zeller5000
8Juancarlos Zeller£4.004Kinley Livingston00070006Kinley Livingston
9Rosalinda Ruffin£2.002Carlos Goss00080001Alberto Holcomb
10Carlos Goss00090002Obed Rosales
11Jim Fontenot0010 
12Jim Fontenot0011 
13Jim Fontenot0012 
14Juancarlos Zeller0013 
15Juancarlos Zeller0014 
16Juancarlos Zeller0015 
17Juancarlos Zeller0016 
18Rosalinda Ruffin0017 
19Rosalinda Ruffin0018 
20 
21 
22 
Sheet1
Cell Formulas
RangeFormula
E2:E19E2=TOCOL(IFS(C2:C30>=SEQUENCE(,MAX(C2:C30)),A2:A30),2)
F2:F19F2=SEQUENCE(COUNTA(E:E)-1,1)
K2K2=LET(x,FILTER(F2:F19,COUNTIF(H2:INDEX(H:H,COUNTA(H:H)),F2:F19)=0),INDEX(x,RANDBETWEEN(1,ROWS(x))))
B2:B9B2=C2*1
I2:I22I2=IFERROR(IF(H2="","",XLOOKUP($H2,$F:$F,$E:$E)),"")
Dynamic array formulas.


Thank you.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Similar threads

Forum statistics

Threads
1,223,996
Messages
6,175,862
Members
452,676
Latest member
woodyp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top