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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
3l1w
2d
3l
formula in F1
=VLOOKUP(E1,mytable,2)
above is named mytable
this macro produces all combos
www
wwdrrow = 9
wwl For j = 1 To 3
wdw For k = 1 To 3
wdd For l = 1 To 3
wdl Cells(1, 5) = j
wlw num1 = Cells(1, 6)
wld Cells(1, 5) = k
wll num2 = Cells(1, 6)
dww Cells(1, 5) = l
dwd num3 = Cells(1, 6)
dwl rrow = rrow + 1
ddw Cells(rrow, 1) = num1
ddd Cells(rrow, 2) = num2
ddl Cells(rrow, 3) = num3
dlw Next l
dld Next k
dll Next j
lwwEnd Sub
lwd
lwl
ldw
ldd
ldl
llw
lld
lll

<colgroup><col width="64" span="15" style="width:48pt"> </colgroup><tbody>
</tbody>
 
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;
ABCDEFGHI
WWWW WWWW
DDDD WWWD
LLLL WWWL

<colgroup><col span="7"><col span="2"></colgroup><tbody>
</tbody>
i hope this help you.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,749
Messages
6,126,662
Members
449,326
Latest member
asp123

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