Random number generator

bdd

New Member
Joined
Sep 16, 2009
Messages
2
Our organization sold raffle tickets for a fundraiser. The tickets were numbered 1 - 2500, but we only sold 1100 tickets (the range of tickets sold are 1 - 2500). I have the ticket numbers entered into an excel spreadsheet in a column. I would like to have excel generate a random number from this list of sold tickets (not all tickets were sold). I currently have excel generating a random number from 1 - 2500, but I don't want to generate a random number, look to see if that ticket was sold and if it wasn't generate another random number. Is there a way to reference the list of sold ticket numbers within the random number generator function?
Thanks in advance for your help.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi bdd

Instead of generating a random number 1-2500, generate a random number 1-1100 and take the corresponding ticket from the list of the sold tickets.
 
Upvote 0
Our organization sold raffle tickets for a fundraiser. The tickets were numbered 1 - 2500, but we only sold 1100 tickets (the range of tickets sold are 1 - 2500). I have the ticket numbers entered into an excel spreadsheet in a column. I would like to have excel generate a random number from this list of sold tickets (not all tickets were sold). I currently have excel generating a random number from 1 - 2500, but I don't want to generate a random number, look to see if that ticket was sold and if it wasn't generate another random number. Is there a way to reference the list of sold ticket numbers within the random number generator function?
Thanks in advance for your help.

Hello BDD and Welcome to the Forum !

You have tickets, which are serially-numbered from 1 to 2500. You have sold 1100 tickets (now left with 1400 tickets).

Are you looking for this:
Excel Workbook
ABC
1Ticket No.StatusRandomly-generated sold ticket no.
21SoldSold
32Available1037
43SoldSold
54SoldSold
65SoldSold
76Available1038
87Available1004
98Available290
109Available1085
1110Available176
Sheet1
Excel 2007
Cell Formulas
RangeFormula
B2=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B3=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B4=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B5=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B6=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B7=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B8=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B9=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B10=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
B11=CHOOSE(RANDBETWEEN(1,2),"Sold","Available")
C2=IF(B2="Available",RANDBETWEEN(1,1100),"Sold")
C3=IF(B3="Available",RANDBETWEEN(1,1100),"Sold")
C4=IF(B4="Available",RANDBETWEEN(1,1100),"Sold")
C5=IF(B5="Available",RANDBETWEEN(1,1100),"Sold")
C6=IF(B6="Available",RANDBETWEEN(1,1100),"Sold")
C7=IF(B7="Available",RANDBETWEEN(1,1100),"Sold")
C8=IF(B8="Available",RANDBETWEEN(1,1100),"Sold")
C9=IF(B9="Available",RANDBETWEEN(1,1100),"Sold")
C10=IF(B10="Available",RANDBETWEEN(1,1100),"Sold")
C11=IF(B11="Available",RANDBETWEEN(1,1100),"Sold")


Thanks
 
Upvote 0
Hi!

Sorry my mistake, use =RANDBETWEEB(1,400) if you want to generate random serial numbers of unsold tickets. Or use =RANDBETWEEN(1,1100) if you want to generate the numbers of sold, as the case may be.
 
Upvote 0

Forum statistics

Threads
1,215,184
Messages
6,123,533
Members
449,106
Latest member
techog

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