Picking a Double number

Icewynd

Member
Came across a cool trick for those that want to play doubles, but are having trouble narrowing down the double digit to play.

Look in the last 2 draws and list the digits that are missing from those games.
For example, last 2 draws in Ontario were 065 and 490. The missing digits are 1, 2, 3, 7, 8 and 9. So you would only use doubles with one of those digits: 11, 22, 33, 77, 88 or 99.

This seems to work about 4 times out of 5 but YMMV. :wow:
 

PAB

Member
Hi Icewynd,

Obviously living in the UK we don't have a Lotto like this.
Are you asking if a SpreadSheet formula will help finding the missing digits?

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

PAB

Member
Hi Icewynd,

Are you asking if a SpreadSheet formula will help finding the missing digits?
If you are, here is a formula that I have just put together that will achieve this.
Let's assume that the THREE digits for the combination are in cells B4 : D4 and continuing down.
Put this formula in cell F4 and drag down as far as needed:

=CONCATENATE(IF(COUNTIF($B3:$D4,0)>0,"",0),IF(COUNTIF($B3:$D4,1)>0,"",1),IF(COUNTIF($B3:$D4,2)>0,"",2),IF(COUNTIF($B3:$D4,3)>0,"",3),IF(COUNTIF($B3:$D4,4)>0,"",4),IF(COUNTIF($B3:$D4,5)>0,"",5),IF(COUNTIF($B3:$D4,6)>0,"",6),IF(COUNTIF($B3:$D4,7)>0,"",7),IF(COUNTIF($B3:$D4,8)>0,"",8),IF(COUNTIF($B3:$D4,9)>0,"",9))

I hope this helps.
Please let me know how you get on!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

PAB

Member
Hi Icewynd,

I have been having a lazy afternoon in front of the TV with several cups of coffee.
Thinking about it, if you knew how many times EACH double had been drawn that might be of an advantage to you.
So bearing that in mind and assuming that the THREE digits for the combination are in cells B4 : D4 and continuing down, copy the Macro below into a Module and run it.

IMPORTANT
(1) CHANGE the Sheet named Input in the Macro to the name of the Sheet that you have your draw data in.
(2) Insert a sheet named Results.

Option Explicit

Sub Calculate_Doubles_PAB()
' ***************************************************************************************
' Author - Algorithm written by PAB on the 24-09-2012.
' Objective - Calculate the number of times each double has been drawn.
' ***************************************************************************************
Dim A As Long
Dim B As Long
Dim rng As Range
Dim rw As Range
Dim wsResult As Worksheet
Dim strDouble As String
Dim lRow1 As Long
Dim lRow2 As Long
Dim lastr As Long
With Application
.ScreenUpdating = False: .Calculation = xlCalculationManual: .DisplayAlerts = False
End With
Worksheets("Input").Select
lastr = Columns(2).Find(What:="*", LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False, _
SearchFormat:=False).Row
Set rng = ActiveSheet.Range("B4: D" & lastr)
Set wsResult = ActiveWorkbook.Worksheets("Results")
wsResult.UsedRange.Delete
With wsResult
.Range("A2").Value = "String"
.Range("B2").Value = "n1"
.Range("B2").Font.Bold = True
.Range("C2").Value = "n2"
.Range("C2").Font.Bold = True
.Range("D2").Value = "Drawn"
.Range("D2").Font.Bold = True
End With
On Error GoTo 0
lRow1 = 3
For Each rw In rng.Rows
For A = 1 To 2
For B = A + 1 To 3
strDouble = rw.Cells(A).Value & "_" & _
rw.Cells(B).Value
On Error Resume Next
lRow2 = Application.WorksheetFunction.Match(strDouble, wsResult.Range("A:A"), False)
If Err.Number > 0 Then
wsResult.Range("A" & lRow1).Value = strDouble
wsResult.Range("B" & lRow1).Value = rw.Cells(A).Value
wsResult.Range("C" & lRow1).Value = rw.Cells(B).Value
wsResult.Range("D" & lRow1).Value = 1
lRow1 = lRow1 + 1
Else
wsResult.Range("D" & lRow2).Value = wsResult.Range("D" & lRow2).Value + 1
End If
On Error GoTo 0
Next B
Next A
Next rw
Worksheets("Results").Select
With wsResult
.Range("A:A").Clear
Range("B2: D2").End(xlDown).Sort _
Key1:=Range("D2"), Order1:=xlDescending, Header:=xlYes, _
Key2:=Range("B2"), Order2:=xlAscending, Header:=xlYes, _
Key3:=Range("C2"), Order3:=xlAscending, Header:=xlYes
.Columns("B: D").EntireColumn.AutoFit
End With
With Application
.DisplayAlerts = True: .Calculation = xlCalculationAutomatic: .ScreenUpdating = True
End With
End Sub

Let me know how you get on!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Icewynd

Member
Hmmmmmmm. I posted yesterday to thank you for your formula for counting the missing numbers, but that post seems to have disappeared! Strange... :look:

Anyway, now I need to say DOUBLE Thank You! :beer: Have one on me (that coffee will rot yur innards).
 

PAB

Member
You're welcome Icewynd,

Was either or both of them any good for what you are trying to do?

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Icewynd

Member
Yes! The first is very helpful -- as I explained in the post that vanished, being able to count the missing digits, by a method other than visual scanning, will allow me to backtest this method to see how it works longer term.

I don't need to know how many times the digits appeared, but I have filed that one away, because it could well come in handy in the future.

Again, Thanks! and Well Done!
 

PAB

Member
No problem and good luck!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

smandula

Member
I have a problem, debug appears

Key2:=Range("B2"), Order2:=xlAscending, Header:=xlYes, _
Key3:=Range("C2"), Order3:=xlAscending, Header:=xlYes
.Columns("B: D").EntireColumn.AutoFit <-----------
End With

Otherwise nice macro
 

PAB

Member
Hi smandula,

smandula said:
I have a problem, debug appears:

Key2:=Range("B2"), Order2:=xlAscending, Header:=xlYes, _
Key3:=Range("C2"), Order3:=xlAscending, Header:=xlYes
.Columns("B: D").EntireColumn.AutoFit <-----------
End With

Otherwise nice macro
Thanks.
There shouldn't be a space between the : and the D.
I put the space there because without the space it produces a Green Smiley as represented in the Smilies table.
Let me know how you get on!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

PAB

Member
You're welcome smandula,

There are a couple of instances where the colon symbol followed by an alpha are also parameters for Smilies, I personally found that putting a space in between them is probably the best solution to overcome this.
Anyway, I am glad that it worked and you like the Macro. I hope you will find it useful.
Good luck!

Regards,
PAB
:wavey:

-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
 

Sidebar

Top