Generate numbers with criteria based on a series of data

marus

New Member
Joined
Apr 23, 2011
Messages
12
Let say we have a lottery with 6 numbers extracted between 1 and 40
Here are some examples of extractions:
1, 5, 23, 35, 11, 6
12, 15, 24, 6, 7, 38
2, 25, 32, 17, 14, 11

I want to generate a series of 9 numbers based on a data base like those extractions in the example with the condition that in any order you take them they have never been extracted as 6 numbers before.
Like 3, 4, 8, 9, 10, 13, 16, 18, 19

Please help, I need this in a hurry.
 
Ok let me restate.
So it's a lottery game with numbers from 1 to 49.
Six numbers are extracted without repetition.
I have a big part of the history of extractions.
Also there is a possibility to enter 9 numbers on a ticket instead of 6 but at a cost. There will be still 6 numbers extracted but since you played 9 you have a bigger chance to hit those 6.

So what I want basically is a script that using the history that I have, it will generate a set of 9 numbers in which any combination you take them as 6, each combination has never been extracted before.
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
So you want only 6 different numbers in a combination that hasn't occurred before. And you have somewhere 3 more numbers (which it doesn't matter if they're repeated within the 6, or within themselves, or ??)

The code I gave you, does it do what you want or not?

Specifically, is there some kind of different output you want listed. If so, specifically what?
 
Upvote 0
Combinations of 9 taken as 6 = 84 sets of 6 numbers. I want those 84 combinations then to be checked against the database.

But I want it the other way around meaning the script to generate those 9 numbers in which any combination of 6 of them haven't occurred yet.
 
Upvote 0
I checked my math from highschool and I think permutations is the right term instead of combinations and the result is much higher.
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,507
Members
452,917
Latest member
MrsMSalt

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