Having problems with my Lottery Generator Please Help!

studfin

New Member
Joined
Jan 5, 2014
Messages
30
I've made a Lottery Generator for Mega Millions and the lottery numbers are generated in a unique way,
the chart that I'm using looks like this:

Ball 1Ball 2Ball 3Ball 4Ball 5MegaBall
010211404701
021112476302
03123552720
000000
000000
000000
000000
000000
000000
00000
00000
00000
00000
00000
00000
00000
00000
00000

<colgroup><col width="64" span="6" style="width:48pt"> </colgroup><tbody>
</tbody>


I pick a array of numbers to be put under each Ball number (Ball 1 - Ball 5 + Mega Ball), and then have
it generated under each ball number in (Permutation) ascending order which it does. But I'm having 3 problems with it.


1st. as you can see from the generated numbers shown below in red it has repeats within the same lines of the combination.

010235527202
011111404701
011111404702
011111406301
011111406302
011111407201
011111407202
011111474701
011111474702
011111476301

<colgroup><col><col span="3"><col><col></colgroup><tbody>
</tbody>

2nd. The number 03 under ball 1 loops back to the 1st number under ball 2 which is 02 when it should go to the next
higher 11 under ball 2.

021235527201
021235527202
030211404701
030211404702

<colgroup><col><col span="3"><col><col></colgroup><tbody>
</tbody>





031112404701

<tbody>
</tbody>

3rd. starts generating the combinations multiple times and won't stop until it reaches row 20001, I just
wanted it to generate it 1 time.

031235527201
031235527202
010211404701
010211404702

<colgroup><col><col span="3"><col><col></colgroup><tbody>
</tbody>

can someone help me with these 3 problems


Formulae that I'm using:


W2:AB2 are hard coded =0


W3 =IF(SUM(X3:AB3)=0,MOD(W2+1,Sheet1!$H$18),W2)
X3 =IF(SUM(Y3:AB3)=0,MOD(X2+1,Sheet1!$J$18),X2)
Y3 =IF(SUM(Z3:AB3)=0,MOD(Y2+1,Sheet1!$L$18),Y2)
Z3 =IF(SUM(AA3:AB3)=0,MOD(Z2+1,Sheet1!$N$18),Z2)
AA3 =IF(SUM(AB3)=0,MOD(AA2+1,Sheet1!$P$18),AA2)
AB3 =MOD(AB2+1,Sheet1!$R$18)


Q2 =INDEX(Sheet1!$H$19:$H$26,'Lottery Generator'!W2+1)
R2 =INDEX(Sheet1!$J$19:$J$26,'Lottery Generator'!X2+1)
S2 =INDEX(Sheet1!$L$19:$L$26,'Lottery Generator'!Y2+1)
T2 =INDEX(Sheet1!$N$19:$N$26,'Lottery Generator'!Z2+1)
U2 =INDEX(Sheet1!$P$19:$P$26,'Lottery Generator'!AA2+1)
V2 =INDEX(Sheet1!$R$19:$R$26,'Lottery Generator'!AB2+1)


And I Fill from row 3 down as TO row 20001 as Total shows on 'Lottery Generator' Sheet
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,172
Messages
6,123,428
Members
449,099
Latest member
COOT

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