Needing help with formulas

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,
Ball 1 is in cell A1 - Ball 5 is in cell E1 and the Mega Ball is in cell F1


the chart that I'm using looks like this:

Ball 1Ball 2Ball 3Ball 4Ball 5MegaBall
040533455501
091142476205
131747576611
02100710
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 ascending order which it does. But I'm having 2 problems with it,
1st. as you can see from the generated numbers shown below it 04,05,42,57,71,11 to 04,05,47,45,55,01
when it should be 04,05,47,57,62,01. The number 47 under ball 3 loops back to the 1st number under
ball 4 which is 45 when it should go to 57 which is higher than 47 under Ball 3.

040542577111
040547455501
040547455505
040547455511
040547456201
040547456205
040547456211
040547456601
040547456605
040547456611
040547457101
040547457105
040547457111
040547475501
040547475505
040547475511
040547476201
040547476205
040547476211
040547476601
040547476605
040547476611
040547477101
040547477105
040547477111
040547575501
040547575505
040547575511
040547576201

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

2nd. as you can see from the generated numbers shown below it loops back to the beginning and starts
generating the numbers all over again, I just wanted to generate it 1 time.





132147576601
132147576605
132147576611
132147577101
132147577105
132147577111
040533455501
040533455505
040533455511
040533456201
040533456205
040533456211

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

can someone help me with these 2 problems

B1 in cells Q2-Q10001, B2 in cells R2-R10001, B3 in cells S2-S10001, B4 in cells T2-T10001, B5 in cells U2-U10001, and MB in cells V2-V10001


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)


Q3 =INDEX(Sheet1!$H$19:$H$26,'Lottery Generator'!W3+1)
R3 =INDEX(Sheet1!$J$19:$J$26,'Lottery Generator'!X3+1)
S3 =INDEX(Sheet1!$L$19:$L$26,'Lottery Generator'!Y3+1)
T3 =INDEX(Sheet1!$N$19:$N$26,'Lottery Generator'!Z3+1)
U3 =INDEX(Sheet1!$P$19:$P$26,'Lottery Generator'!AA3+1)
V3 =INDEX(Sheet1!$R$19:$R$26,'Lottery Generator'!AB3+1)


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

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,215,176
Messages
6,123,470
Members
449,100
Latest member
sktz

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