starl
Administrator
- Joined
- Aug 16, 2002
- Messages
- 6,091
- Office Version
- 365
- Platform
- Windows
I have 2 teams - Team A and Team B. I need to randomly group one player from each team. These groupings need to happen multiple times, and none of the groupings can be repeated between those times. Nor can a player be listed more than once within a week
So in my example below, columns A & B are my teams and players. Columns D:F show sample groupings (D&E are not very random, F is just a formula I threw in, but as you see, it doesn't always work). F10 and F25 are highlighted in red because that's the same group up in two different weeks and that's not allowed. Nor would a repeat of a group within a week or a single player listed twice in a week (F7&F18). I don't care if the solution is a formula or code. Week1 & Week2 are not very random and using that logic to generate the rest of the weeks (I need 10 total), would not be very random.
I'm showing my formula because I had it there, but it isn't what I expect the solution to be (especially since it would only generate a single week and there's no comparison to previous weeks to ensure non-duplicates)
So in my example below, columns A & B are my teams and players. Columns D:F show sample groupings (D&E are not very random, F is just a formula I threw in, but as you see, it doesn't always work). F10 and F25 are highlighted in red because that's the same group up in two different weeks and that's not allowed. Nor would a repeat of a group within a week or a single player listed twice in a week (F7&F18). I don't care if the solution is a formula or code. Week1 & Week2 are not very random and using that logic to generate the rest of the weeks (I need 10 total), would not be very random.
I'm showing my formula because I had it there, but it isn't what I expect the solution to be (especially since it would only generate a single week and there's no comparison to previous weeks to ensure non-duplicates)
bellevue.xlsx | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Team A | Team B | Week 1 | Week2 | Week3 | |||
2 | B1 | A1 | B1-A1 | B1-A2 | B14-A23 | |||
3 | B2 | A2 | B2-A2 | B2-A3 | B8-A26 | |||
4 | B3 | A3 | B3-A3 | B3-A4 | B16-A3 | |||
5 | B4 | A4 | B4-A4 | B4-A5 | B4-A14 | |||
6 | B5 | A5 | B5-A5 | B5-A6 | B3-A15 | |||
7 | B6 | A6 | B6-A6 | B6-A7 | B22-A16 | |||
8 | B7 | A7 | B7-A7 | B7-A8 | B19-A7 | |||
9 | B8 | A8 | B8-A8 | B8-A9 | B7-A6 | |||
10 | B9 | A9 | B9-A9 | B9-A10 | B24-A25 | |||
11 | B10 | A10 | B10-A10 | B10-A11 | B16-A21 | |||
12 | B11 | A11 | B11-A11 | B11-A12 | B7-A19 | |||
13 | B12 | A12 | B12-A12 | B12-A13 | B3-A23 | |||
14 | B13 | A13 | B13-A13 | B13-A14 | B10-A26 | |||
15 | B14 | A14 | B14-A14 | B14-A15 | B4-A11 | |||
16 | B15 | A15 | B15-A15 | B15-A16 | B12-A19 | |||
17 | B16 | A16 | B16-A16 | B16-A17 | -A9 | |||
18 | B17 | A17 | B17-A17 | B17-A18 | B22-A4 | |||
19 | B18 | A18 | B18-A18 | B18-A19 | B13-A18 | |||
20 | B19 | A19 | B19-A19 | B19-A20 | B23-A11 | |||
21 | B20 | A20 | B20-A20 | B20-A21 | B15-A25 | |||
22 | B21 | A21 | B21-A21 | B21-A22 | B8-A19 | |||
23 | B22 | A22 | B22-A22 | B22-A23 | -A22 | |||
24 | B23 | A23 | B23-A23 | B23-A24 | B24-A19 | |||
25 | B24 | A24 | B24-A24 | B24-A25 | B2- | |||
26 | B25 | A25 | B25-A25 | B25-A26 | B4-A18 | |||
27 | B26 | A26 | B26-A26 | B26-A1 | B9-A6 | |||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F2 | F2 | =OFFSET($A$1,RANDBETWEEN(2,27),0)&"-" &OFFSET($B$1,RANDBETWEEN(2,27),0) |