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:
<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.
<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.
<colgroup><col><col span="3"><col><col></colgroup><tbody>
</tbody>
<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.
<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
the chart that I'm using looks like this:
Ball 1 | Ball 2 | Ball 3 | Ball 4 | Ball 5 | MegaBall |
01 | 02 | 11 | 40 | 47 | 01 |
02 | 11 | 12 | 47 | 63 | 02 |
03 | 12 | 35 | 52 | 72 | 0 |
0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | |
<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.
01 | 02 | 35 | 52 | 72 | 02 |
01 | 11 | 11 | 40 | 47 | 01 |
01 | 11 | 11 | 40 | 47 | 02 |
01 | 11 | 11 | 40 | 63 | 01 |
01 | 11 | 11 | 40 | 63 | 02 |
01 | 11 | 11 | 40 | 72 | 01 |
01 | 11 | 11 | 40 | 72 | 02 |
01 | 11 | 11 | 47 | 47 | 01 |
01 | 11 | 11 | 47 | 47 | 02 |
01 | 11 | 11 | 47 | 63 | 01 |
<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.
02 | 12 | 35 | 52 | 72 | 01 |
02 | 12 | 35 | 52 | 72 | 02 |
03 | 02 | 11 | 40 | 47 | 01 |
03 | 02 | 11 | 40 | 47 | 02 |
<colgroup><col><col span="3"><col><col></colgroup><tbody>
</tbody>
03 | 11 | 12 | 40 | 47 | 01 |
<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.
03 | 12 | 35 | 52 | 72 | 01 |
03 | 12 | 35 | 52 | 72 | 02 |
01 | 02 | 11 | 40 | 47 | 01 |
01 | 02 | 11 | 40 | 47 | 02 |
<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