up to 20 teams each play each other only once?

tonylpcs@yahoo.co.uk

Active Member
Joined
Dec 19, 2007
Messages
379
hi everyone,

i have a chess competion and im trying to get a way to create the compation list for each week.

the max number for person taking part will be 20 but this could be less (but will be an even number)

now one game is to be played each week until everyone has played each other!

the problem ive go is creating a way to create a week by week compation list so each person plays the other only once but takes into acount the number of players taking place?

i.e. when the competion starts if only 6 people have entred then i need to do it so each of the 6 play each other but if 20 enter the it goes on for more weeks and all 20 need to play each other.

any idea how i can do this?

tony
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This may or may not help !!
This code gives you an array of numbers as you will see when you run the code, that can be added to without disturbing the original numbers.
Change total where shown in code.
Code:
[COLOR="Navy"]Sub[/COLOR] MG16Jul20
[COLOR="Navy"]Dim[/COLOR] c       [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] ac      [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] rw      [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] p       [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] tot     [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
c = 1
tot = 10 '[COLOR="Green"][B] Change Total Numbers of players here !![/B][/COLOR]
[COLOR="Navy"]For[/COLOR] ac = 1 To tot - 1
    Cells(c, 1).Resize(, tot - ac) = ac
        c = c + 1
        [COLOR="Navy"]For[/COLOR] rw = 1 To tot
            [COLOR="Navy"]If[/COLOR] Not rw = ac And rw > ac [COLOR="Navy"]Then[/COLOR]
                p = p + 1
                Range("A" & c)(, p) = rw
            [COLOR="Navy"]End[/COLOR] If
        [COLOR="Navy"]Next[/COLOR] rw
            c = c + 2
            p = 0
[COLOR="Navy"]Next[/COLOR] ac
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Hi,
I'm sorry for the intrusion,but what would be the matrix if there are 3 people in each table (playing Card game) and the total of 21,or what line in the code to be amended to accomodate the change?
Thanks
 
Upvote 0

Forum statistics

Threads
1,224,545
Messages
6,179,432
Members
452,915
Latest member
hannnahheileen

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