Pick 4 Excel Formula

figgy911

Member
Does anyone know what formula to use to calculate all 10,000 possible combinations for straight play in Pick 4?

Thank you,
Paul
 

PAB

Member
Hi Paul,

Welcome to the Board.
What is Straight Play?.
How Many Numbers are the 4 Drawn from?.

All the Best.
PAB
:wavey:
 

GillesD

Member
Combinations for a Pick 4

I assume that for about 10,000 combinations in a Pick 4, you choose 4 numbers out of 24 (there are then 10,626 combinations). The following macro wil generate all combinations starting in A2 of the current sheet when you start the macro with a sequential number in column A and the 4 numbers in columns B to E.

Option Explicit
Dim A As Integer, B As Integer, C As Integer, D As Integer
Dim N As Integer, X As Double
Sub Combin_4x()
' Generates all combinations for a pick-4 lottery
' in N numbers
N = 24
Range("A1").Select
X = 1
For A = 1 To N - 3
For B = A + 1 To N - 2
For C = B + 1 To N - 1
For D = C + 1 To N
ActiveCell.Offset(X, 0).Value = X
ActiveCell.Offset(X, 1).Value = A
ActiveCell.Offset(X, 2).Value = B
ActiveCell.Offset(X, 3).Value = C
ActiveCell.Offset(X, 4).Value = D
X = X + 1
Next D
Next C
Next B
Next A
End Sub

If you want to get combinations from other than 24 numbers, just change the value of N (in N=24) near the top of the macro. It should work up to a value of 36 where, after that, you will reach the bottom of the sheet.

If you want to restrict the combinations listed, you could start an IF condition THEN loop just after the FOR D=C + 1 To N line and finishing with an END IF just before the Next D line. only the combinations meeting the condition will then be listed.
 

tomtom

Member
Geez…...:confused:...the two old time members of this forum do not know how a pick4 is played…...even one of them has it available at a retailer's.

So, same as pick3, but there are 4 numbers drawn instead of 3.
Possible combinations go like

0-0-0-0
0-0-0-1
0-0-0-2

etc, up to

9-9-9-9

and, there are 10,000 combinations altogether.
 

GillesD

Member
Modification for tomtom

You were right tomtom at the time I read the question I was not thinking right. So to make it up to you, I have modified my macro to list all those numbers. The same comment for any specific condition still apply.

Option Explicit
Dim A As Integer, B As Integer, C As Integer, D As Integer
Dim X As Double

Sub Combin_4x()
' Generates all combinations for a pick-4 lottery
Range("A1").Select
X = 1
For A = 0 To 9
For B = 0 To 9
For C = 0 To 9
For D = 0 To 9
ActiveCell.Offset(X, 0).Value = X
ActiveCell.Offset(X, 1).Value = A
ActiveCell.Offset(X, 2).Value = B
ActiveCell.Offset(X, 3).Value = C
ActiveCell.Offset(X, 4).Value = D
X = X + 1
Next D
Next C
Next B
Next A
End Sub
 

tomtom

Member
GillesD said:
You were right tomtom at the time I read the question I was not thinking right.

No, it was my mistake....the game available to you is called La Quotidienne 4.

And, without a lottery corp that has numbers drawn using ball machines in all games, or at least huge majority altogether with that many games where "must play quick picks if play the game " doesn't exists by any means, and that has all facts about all games clearly at the web site, the lottery world wouldn't be the same.....
 

jack

Member
mega60/6

Hello, GILLES his macro can help me? It is a set of 60/6, (mega senna)
Example results =
03 16 23 25 51 56
02 10 15 44 56 57
08 19 46 51 52 54
07 14 15 20 23 35
03 05 11 36 44 46
06 19 22 34 43 45
07 10 32 43 47 54
07 08 24 30 33 47
The macro must separate the digits that are the front = 0,1,2,3,4,5,6.
And combine in = 1,2,3,4, 1,2,3,5, 1,2,3,6... 3,4,5,6 = up 15 positions are ok
So we will work with the front digit of the number, ok, will put in 15 positions
Example 1 results
1,2,3,4 .... = 3,4,5,6 are up to 15 positions
0,1,2,2
Objetico is set in front of the four digit numbers, that is, a part of the system,
After how many combinations are possible in = 0000-5555. , GILLEsd will not until 6 because of a lottery, from 01 to 60 has only one number that begins with the digit 6.
I have seven Windows and Excel 2010, you know when I win a nice prize will be 20% too because that helps, the results have option to go upgrading.
 

PAB

Member
Hi emilyng,

Sorry, can you show me how to use your code into the excel?
Here you go.

(01) Open a blank WorkBook.
(02) Press Alt+F8.
(03) Type in the Macro name.
(04) Click CREATE.
(05) Copy the code into what will be Module1.
(06) Click File (top left of screen).
(07) Click Close and Return to Microsoft Excel.
(08) Save the WorkBook (just in case).

To RUN the Macro ...

(09) Press Alt+F8.
(10) Click the Macro name.
(11) Click Run.
(12) Wait for the results to be produced.

This could take a minute or so depending on the speed of your computer.
Hope this explains it OK!

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