The three main posiible outcome of a football match =27 and 64 for fout matches, list all 64 possible predictions

mass junior high

New Member
Joined
May 13, 2017
Messages
9
VB:
Sub stuff()
Const v& = 3
Dim z, y() As String , q()
Dim a&, b&, c&, d&, p&, MaxRow& MaxRow = 65536 z = Array("H", "D", "A") u = UBound (z) + 1
Redim y(1 To u ^ v, 1 To v)
For a = 1 To v
For b = 1 To u ^ v Step u ^ a
For c = b To b + u ^ (a - 1) - 1
For d = 1 To u y(c + u ^ (a - 1) * (d - 1), v - a + 1) = z(d - 1)
Next d, c, b, a
For a = 1 To u ^ v Step MaxRow
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
[TABLE="width: 960"]
<colgroup><col width="64" span="15" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64, align: right"]3[/TD]
[TD="width: 64"]l[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64, align: right"]1[/TD]
[TD="width: 64"]w[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD]d[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD]l[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]formula in F1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"]=VLOOKUP(E1,mytable,2)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"]above is named mytable[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"]this macro produces all combos[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]w[/TD]
[TD]w[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]w[/TD]
[TD]d[/TD]
[TD][/TD]
[TD][/TD]
[TD]rrow = 9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]w[/TD]
[TD]l[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] For j = 1 To 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]d[/TD]
[TD]w[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] For k = 1 To 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]d[/TD]
[TD]d[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] For l = 1 To 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]d[/TD]
[TD]l[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] Cells(1, 5) = j[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]l[/TD]
[TD]w[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] num1 = Cells(1, 6)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]l[/TD]
[TD]d[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] Cells(1, 5) = k[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]w[/TD]
[TD]l[/TD]
[TD]l[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] num2 = Cells(1, 6)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]w[/TD]
[TD]w[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] Cells(1, 5) = l[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]w[/TD]
[TD]d[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] num3 = Cells(1, 6)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]w[/TD]
[TD]l[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"] rrow = rrow + 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]d[/TD]
[TD]w[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"] Cells(rrow, 1) = num1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]d[/TD]
[TD]d[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"] Cells(rrow, 2) = num2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD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TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Thanks for your reply, provided with 64 combination for 4 marches, I wish to a line every four combination by the total number of matches which is four.
Example, let the 4 matches for a given combo be considered as a ticket.
Ticket1. Ticket2 ticket3 Ticket4 Ticket5
1) W. W. W. W. L
2) W W w l L
3) W w d d L
4) W d. d w L
I will be forever grateful for your help. Thanks
 
Upvote 0
I do not understand your post 5

are you saying I can buy a ticket and select the permutation eg WWLDW and then you check to see if I am a winner ?

or do you want a RANDOM permutation to be generated when I buy a ticket
 
Upvote 0
Thanks for your help,
if I select 4 games with 3 outcomes( win, draw and lose) there will be 64 possible combinations therefore, 64 tickets ,eg t1, wwww, t2, wwwd, t3,wwwl. And so on 1 winning ticket,63 losing tickets.
I want to generate all 64 permutation.
I will also like to generate a permutation for 12 matches with 2 outcomes win(W) and lose(l). Since there are 144 permutations.
 
Upvote 0
can you not see how to modify the macro in my post 2 to give you 64 PERMUTATIONS (WWD and DWW are the same combination)
 
Upvote 0
Whenever I type the code on a macros, nothing happens don't know if there's something I left, I study excel in secondary am good in carrying out basic calculations until I learnt I knew nothing when things like Marcos existed on excel ,while doing my research.
 
Upvote 0
HI,
4 Matches with 3 outcomes is 81 lines you need,also 12 team with 2 outcomes is 4096 lines not 144.
here is a Macro from PGC from this valuable forum.
Code:
Sub Perm()Application.ScreenUpdating = False
Dim rSets As Range, rOut As Range
Dim vArr As Variant, lrow As Long
 
Set rSets = Range("A1").CurrentRegion
ReDim vArr(1 To rSets.Columns.Count)
Set rOut = Cells(1, rSets.Columns.Count + 3)
Perm1 rSets, vArr, rOut, 1, lrow
End Sub
 
Sub Perm1(rSets As Range, ByVal vArr As Variant, rOut As Range, ByVal lSetN As Long, lrow As Long)
Dim j As Long
 
For j = 1 To rSets.Rows.Count
    If rSets(j, lSetN) = "" Then Exit Sub
    vArr(lSetN) = rSets(j, lSetN)
    If lSetN = rSets.Columns.Count Then
        lrow = lrow + 1
        rOut(lrow).Resize(1, rSets.Columns.Count).Value = vArr
    Else
        Perm1 rSets, vArr, rOut, lSetN + 1, lrow
    End If
Next j
Application.ScreenUpdating = True
End Sub
and this is how to put your data;
[TABLE="width: 286"]
<colgroup><col span="7"><col span="2"></colgroup><tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD]W[/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD] [/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]D[/TD]
[TD]D[/TD]
[TD]D[/TD]
[TD] [/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]L[/TD]
[TD]L[/TD]
[TD]L[/TD]
[TD]L[/TD]
[TD] [/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD]W[/TD]
[TD]L[/TD]
[/TR]
</tbody>[/TABLE]
i hope this help you.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,721
Messages
6,174,097
Members
452,542
Latest member
Bricklin

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