I use this code to find the most frequently issued number from past combinations. Can be adapted to any lottery. I use it for Keno. This is my little contribution to this forum. Maybe someone already published it. If so, accept my apologies.
To be put in an Excel module:
Option Explicit
Sub Frequency()
Dim t, i As Long, j As Long, Dico, Clé, tmp1, tmp2, OK As Boolean, T2
With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
.CutCopyMode = False
End With
On Error Resume Next
[d6:w6].ClearContents
Set Dico = CreateObject("Scripting.Dictionary")
With Worksheets("Keno") ' Name of your sheet
t = .Range("d10:w200") 'Adapt the Area of search
For i = LBound(t, 1) To UBound(t, 1)
For j = LBound(t, 2) To UBound(t, 2)
If t(i, j) <= 70 Then Dico(t(i, j)) = Dico(t(i, j)) + 1 '70 number can be modify to 80 or less
Next
Next
T2 = Application.Transpose(Array(Dico.keys, Dico.Items))
While OK = False
OK = True
For i = LBound(T2, 1) To UBound(T2, 1) - 1
If T2(i, 2) < T2(i + 1, 2) Then
tmp1 = T2(i, 1)
tmp2 = T2(i, 2)
T2(i, 1) = T2(i + 1, 1)
T2(i, 2) = T2(i + 1, 2)
T2(i + 1, 1) = tmp1
T2(i + 1, 2) = tmp2
OK = False
End If
Next
Wend
.[d6].Resize(1, 10) = Application.Transpose(T2) 'The size number can be modify
End With
Err.Clear
With Application
.DisplayAlerts = True
.ScreenUpdating = True
.EnableEvents = True
.CutCopyMode = True
End With
End Sub