Create a dynamic football tournament event macro

MrPink1986

Active Member
Joined
May 1, 2012
Messages
252
Hi there,

I would like to create a macro that would save me so much time and also be fully correct as my current approach is quite manual.
Let me describe what I require:

Inputs;
Team Name- this will list the teams taking part - this will range from 1-16
Number of Groups - this will be range from 1-4
No of teams in the group - this will range from 3-5

Logic;
The number of teams in the group in the number of groups will come from the Team name and list and will only contain unique values.

Inputs;
Number of Pitches - 2-4
Event start Time - time value xx:xx
Length of each game - variable 5-15 mins

Logic;
The macro should create start times for each game and assign each game a pitch number. There should only be one game at each time with that team involved. Once the first game is completed the macro should be able to list the next kick off time - the first game will conclude when the Event start Time + Length of each game + 3 mins elapses.

Below is the final output

[TABLE="width: 2138"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]GROUP A[/TD]
[TD]GROUP B[/TD]
[TD]GROUP C[/TD]
[TD]GROUP D[/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]Team name[/TD]
[TD]Team name[/TD]
[TD]Team name[/TD]
[TD]Team name[/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]Team A[/TD]
[TD]Team E[/TD]
[TD]Team I[/TD]
[TD]Team M[/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]Team B[/TD]
[TD]Team F[/TD]
[TD]Team J[/TD]
[TD]Team n[/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]Team C[/TD]
[TD]Team G[/TD]
[TD]Team K[/TD]
[TD]Team O[/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]Team D[/TD]
[TD]Team H[/TD]
[TD]Team L[/TD]
[TD]Team P[/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]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Group A[/TD]
[TD]Pitch[/TD]
[TD]Kickoff Time[/TD]
[TD][/TD]
[TD="colspan: 2"]Group B[/TD]
[TD]Pitch[/TD]
[TD]Kickoff Time[/TD]
[TD][/TD]
[TD="colspan: 2"]Group C[/TD]
[TD]Pitch[/TD]
[TD]Kickoff Time[/TD]
[TD][/TD]
[TD="colspan: 2"]Group D[/TD]
[TD]Pitch[/TD]
[TD]Kickoff Time[/TD]
[/TR]
[TR]
[TD]Team A[/TD]
[TD]Team B[/TD]
[TD]A[/TD]
[TD]17:30[/TD]
[TD][/TD]
[TD]Team E[/TD]
[TD]Team F[/TD]
[TD]B[/TD]
[TD]17:30[/TD]
[TD][/TD]
[TD]Team I[/TD]
[TD]Team J[/TD]
[TD]C[/TD]
[TD]17:30[/TD]
[TD][/TD]
[TD]Team M[/TD]
[TD]Team n[/TD]
[TD]D[/TD]
[TD]17:30[/TD]
[/TR]
[TR]
[TD]Team B[/TD]
[TD]Team C[/TD]
[TD]A[/TD]
[TD]17:45[/TD]
[TD][/TD]
[TD]Team F[/TD]
[TD]Team G[/TD]
[TD]B[/TD]
[TD]17:45[/TD]
[TD][/TD]
[TD]Team J[/TD]
[TD]Team K[/TD]
[TD]C[/TD]
[TD]17:45[/TD]
[TD][/TD]
[TD]Team n[/TD]
[TD]Team O[/TD]
[TD]D[/TD]
[TD]17:45[/TD]
[/TR]
[TR]
[TD]Team A[/TD]
[TD]Team D[/TD]
[TD]A[/TD]
[TD]18:00[/TD]
[TD][/TD]
[TD]Team E[/TD]
[TD]Team H[/TD]
[TD]B[/TD]
[TD]18:00[/TD]
[TD][/TD]
[TD]Team I[/TD]
[TD]Team L[/TD]
[TD]C[/TD]
[TD]18:00[/TD]
[TD][/TD]
[TD]Team M[/TD]
[TD]Team P[/TD]
[TD]D[/TD]
[TD]18:00[/TD]
[/TR]
[TR]
[TD]Team C[/TD]
[TD]Team A[/TD]
[TD]A[/TD]
[TD]18:15[/TD]
[TD][/TD]
[TD]Team G[/TD]
[TD]Team E[/TD]
[TD]B[/TD]
[TD]18:15[/TD]
[TD][/TD]
[TD]Team K[/TD]
[TD]Team I[/TD]
[TD]C[/TD]
[TD]18:15[/TD]
[TD][/TD]
[TD]Team O[/TD]
[TD]Team M[/TD]
[TD]D[/TD]
[TD]18:15[/TD]
[/TR]
[TR]
[TD]Team D[/TD]
[TD]Team C[/TD]
[TD]A[/TD]
[TD]18:30[/TD]
[TD][/TD]
[TD]Team H[/TD]
[TD]Team G[/TD]
[TD]B[/TD]
[TD]18:30[/TD]
[TD][/TD]
[TD]Team L[/TD]
[TD]Team K[/TD]
[TD]C[/TD]
[TD]18:30[/TD]
[TD][/TD]
[TD]Team P[/TD]
[TD]Team O[/TD]
[TD]D[/TD]
[TD]18:30[/TD]
[/TR]
[TR]
[TD]Team B[/TD]
[TD]Team D[/TD]
[TD]A[/TD]
[TD]18:45[/TD]
[TD][/TD]
[TD]Team F[/TD]
[TD]Team H[/TD]
[TD]B[/TD]
[TD]18:45[/TD]
[TD][/TD]
[TD]Team J[/TD]
[TD]Team L[/TD]
[TD]C[/TD]
[TD]18:45[/TD]
[TD][/TD]
[TD]Team n[/TD]
[TD]Team P[/TD]
[TD]D[/TD]
[TD]18:45[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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