Lotto Program Request
Hi Everyone,
Here are the Excel Formulas to Enter into an Excel Worksheet to Calculate the Total Number of Matches ( 0, 1, 2, 3, 4, 5, 5+ & 6 ) for a Combination(s) in ALL Lotto Draws. These are for a 649 Lotto with One Bonus Number Drawn.
**************************************************
Lotto Draw Results Criteria.
In Cell B5 and Going Down, Enter the Draw Number.
In Cell C5 and Going Down, Enter the Draw Day if you Keep that Information, Otherwise Leave it Blank.
In Cell D5 and Going Down, Enter the Draw Date if you Keep that Information, Otherwise Leave it Blank.
In Cells E5:J5 and Going Down, Enter the Lotto Numbers Drawn.
In Cell K5 and Going Down, Enter the Bonus Ball Number.
The Cells Above B5:K5 can be Used for Titles Or Labels.
**************************************************
Combination(s) to Check Criteria.
In Cell M5 and Going Down, Enter Some Description so that you will know which Combination Number you are Checking.
In Cells N5:S5 and Going Down, Enter the Combinations to be Checked ( Leave Blank for the Time Being ).
The Cells Above M5:S5 can be Used for Titles Or Labels.
**************************************************
To Calculate the Number of Matches for EACH Combination for EACH Draw Criteria.
In Cells U4:IU4 Enter the Numbers 1 to 235, this will Make it Easier to see the Data Associated with the Combination Number to Check.
In Cell U1 ( Copy & Paste from Here ), Enter the Formula :-
="$N$" & COLUMN()-16 & ":$S$" & COLUMN()-16
This is so the Array of Numbers from Columns N to S DOESN'T Change as the Row Changes But DOES Change as the Column Changes when Copied Across in the Formula Below.
In Cell U5 ( Copy & Paste from Here ), Enter the Formula ( Array Entered, Ctrl + Shift + Enter will give you Curly Brackets at EACH End of the Formula, Do NOT Enter these yourself ) :-
=IF($N$5=0," ",IF(COUNT(MATCH(INDIRECT(U$1),$E5:$J5,0))=5,IF(COUNT(MATCH(INDIRECT(U$1),$K5,0))=1,"5+","5"),COUNT(MATCH(INDIRECT(U$1),$E5:$J5,0))))
Copy this Formula Down to Cell U1504, this will Give you 1,500 Worth of Draws To Date ( if Applicable ) of which to Check Against. If there are More than 1,500 Draws To Date, See the Note Below at the Bottom.
The Cells From U2:IU3 can be Used for Titles Or Labels.
**************************************************
Table of the Total Number of Times EACH Combination has Matched Criteria.
Set the Column Width for Column T to 17.
In Cell T1506, Enter the Text Matched 0
In Cell T1507, Enter the Text Matched 1
In Cell T1508, Enter the Text Matched 2
In Cell T1509, Enter the Text Matched 3
In Cell T1510, Enter the Text Matched 4
In Cell T1511, Enter the Text Matched 5
In Cell T1512, Enter the Text Matched 5+
In Cell T1513, Enter the Text Matched 6
In Cell T1514, Enter the Text Total Draws Tested
In Cell U1506 ( Copy & Paste from Here ), Enter the Formula ( for 0 Matched ) :-
=IF(SUM(U$1507:U$1513)=0,0,COUNTIF($E5:$E1506,">0")-SUM(U$1507:U$1513))
Yes, $E1506, then this Formula will Automatically Adjust if you Insert More Rows for More Lotto Draws ( See the Note Below at the Bottom ).
The Total Number of Times Matched for 0 is Calculated Using the Total Draws To Date LESS the Number of Matches Greater than 0.
In Cell U1507 ( Copy & Paste from Here ), Enter the Formula ( for 1 Matched ) :-
=COUNTIF(U$5:U$1504,"=1")
In Cell U1508 ( Copy & Paste from Here ), Enter the Formula ( for 2 Matched ) :-
=COUNTIF(U$5:U$1504,"=2")
In Cell U1509 ( Copy & Paste from Here ), Enter the Formula ( for 3 Matched ) :-
=COUNTIF(U$5:U$1504,"=3")
In Cell U1510 ( Copy & Paste from Here ), Enter the Formula ( for 4 Matched ) :-
=COUNTIF(U$5:U$1504,"=4")
In Cell U1511 ( Copy & Paste from Here ), Enter the Formula ( for 5 Matched ) :-
=COUNTIF(U$5:U$1504,"=5")
In Cell U1512 ( Copy & Paste from Here ), Enter the Formula ( for 5+ Matched ) :-
=COUNTIF(U$5:U$1504,"=5+")
In Cell U1513 ( Copy & Paste from Here ), Enter the Formula ( for 6 Matched ) :-
=COUNTIF(U$5:U$1504,"=6")
In Cell U1514 ( Copy & Paste from Here ), Enter the Formula ( for Total Draws Tested ) :-
=SUM(U1506:U1513)
**************************************************
What I would Personally do Now is Freeze the Panes at Row Number 5 ( Click Row Number 5, Click Window & Click Freeze Panes ), this will Make Viewing the Table of the Total Number of Times EACH Combination has Matched 0, 1, 2, 3, 4, 5, 5+ & 6 Far More Easier.
NOW, if you Insert 6 Numbers in Cells N5:S5, this will give you ALL the Information of Matching those 6 Numbers ( 1 Combination ) Against ALL the Lotto Draws To Date.
I would Personally Save the File NOW.
To get the Results for More than 1 Combination ( After you have Input More Combinations in Columns N to S ), Highlight Cells U1:U1514 ( Unless you have Inserted More Rows Because there are More than 1,500 Lotto Draws to Date, then the Last Cell Highlighted will be Greater than Cell U1514, See the Note Below ), and Using the Fill Handle, Drag it Across Until you Reach the Required Number of Combinations you are Checking.
This Single Worksheet will Allow you to Check 235 Combinations Against ALL the Draws To Date.
If there are More than 1,500 Lotto Draws, then Simply Click on Row Number 1504 and Drag Down for as Many Rows ( Draws ) that you want to Insert. ALL the Formulas for the Table of the Total Number of Times EACH Combination has Matched will Automatically be Adjusted.
One Important thing, Depending on How Many Combinations you want to Check, and the Total Number of Draws to Date, this will Create a VERY BIG Excel File. It Might be Best to Save the File Prior to ANY Copying Across ( where I Suggested Above ). That way, when to do Copy U1:U1514 Across, and Get the Required Information, you can then Close the File WITHOUT Saving it.
I have gone through the Information Above and Created the File, so Hopefully there will NOT be Any Problems.
To Make it Look Neater, you could Adjust Column Widths and Add Some Colour Maybe.
I Have Tried to Explain this with as Much Information and as Clearly as I can Because I know People have Different Levels of Worksheet Experience and Knowledge. If you Copy & Paste the Formulas where I have Indicated, I think that ALL will go According to Plan.
Have Fun Everyone.
All the Best.
PAB