Round Robin generator

Peter1944

New Member
Joined
Jan 30, 2014
Messages
5
Does anyone know how to generate a Round Robin tournament for 12 to 20 players so everyone plays everyone else only 1 time. Byes are OK
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Does anyone know how to generate a Round Robin tournament for 12 to 20 players so everyone plays everyone else only 1 time. Byes are OK
try a macro. just run it on a blank worksheet
has 12 players. change on the red line if you want another number
Rich (BB code):
Sub round_robin()

Dim c() As Variant, u() As Variant, flg As Byte
Dim i As Long, j As Long, n As Long

n = 12      'change to 20 or whatever as you like
If n Mod 2 = 1 Then n = n + 1: flg = 1
ReDim c(1 To n, 1 To n / 2 + 1), u(1 To n)

For i = 1 To n - 1
    If flg = 1 Then u(n) = "bye" Else u(n) = n
    For j = 1 To n - 1
        u(j) = i + j - 1
        If u(j) > n - 1 Then u(j) = u(j) - n + 1
    Next j
    For j = 1 To n / 2
        c(i, j + 1) = u(j) & "  vs  " & u(n - j + 1)
    Next j
    c(i, 1) = "PLAY " & i
Next i

Range("A1").Resize(n - 1, n / 2 + 1) = c

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,527
Messages
6,125,337
Members
449,218
Latest member
Excel Master

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