True round-robin tournament
Mark G asks in Create a random playlist in excel:
Can this example be modified to create a true round-robin draw?
i.e. using a 6 team scenario, for any round there will be three games/matches, but obviously, Team A could not compete against say Team B and Team C during that round as can occur using the above formula.
Answer:
This example is based on a double round-robin in which every team plays all others in its league once at home and once away randomly.
The picture above shows two playlists, the random playlist is the right one. Each round is divided using conditional formatting.
The worksheet is dynamic meaning you can have more or less teams and the worksheet will automatically generate a random playlist for you.
You can download the workbook at the end of this article.
How to use this workbook
The first playlist table is not random, it simply lists all possible matches for the entered team names. The second list is random.
You type the team names in column B in the Excel defined Table. It automatically expands when new values are entered, you don't need to adjust any formulas or cell references.
Add team names
Simply type the next Team name in the first empty cell below the table.
Delete team names
To delete a name in the Excel defined table you need to select the cells you want to delete.
Then right-click on the selected range.
Click on "Delete" and then click on "Table Rows".
If you accidentally click "Table Columns", don't freak out. Simply press CTRL + z to undo.
Edit team names
You can edit the existing team names as well, the formulas are dynamic and return the correct names in the playlist instantly.
Generate the tournament playlist
There is a button to the right of the playlists.
Click the button to automatically generate a new random playlist determined by the number of teams you have entered in column B.
When you have a playlist you are happy with copy it and paste it to a new worksheet.
What does this workbook contain to make this possible?
Formula in cell D3 and below:
Formula in cell E3 and below:
Formula in cell F3 and below:
Formula in cell H3 and below:
Formula in cell I3 and below:
Formula in cell J3 and below:
Formula in cell K3 and below:
Hidden formula in cell L3 and below:
Hidden formula in cell M2:
Hidden formula in cell M3 and cells below:
VBA Macro
The random playlist sometimes returns error values, the following code verifies that no errors occur.
Sub GeneratePlayList() Application.ScreenUpdating = False Do Calculate DoEvents Loop While Worksheets("Sheet1").Range("M2") <> 0 Application.ScreenUpdating = True End Sub
Download Excel *.xlsx file *.xlsm
How to create a list of random unique numbers
Question: How do I create a random list of unique numbers from say 1 to 10, without using VBA and […]
This article describes how to create a random playlist based on a given number of teams using an array formula. […]
Mark G asks: 1 - I see you could change the formula to have the experssion COUNTIF($C$1:C1, $E$2:$E$5)<5 changed so […]
This blog article describes how to create teams randomly. There are twenty names in column B and four teams in […]
JD asks in this post: Dynamic team generator Hi, what if we have different number of people per team? So in […]
Sort a list in random order in excel
Overview The array formula in cell range C2:C6 creates a random list from the values in cell range A2:A6. Array […]
Assign records unique random text strings
This article demonstrates a formula that distributes given text strings randomly across records in any given day meaning they may […]
How to create random numbers, text strings, dates and time values
The RAND() function In Excel returns a number greater than or equal to 0 (zero) and less than 1. Combining […]
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.