I need a macro that takes a two column table of player names and averages (bowling) and sorts them into a specified # of teams so the resulting average per team is equal or as close to equal as possible. We don't have static teams, we assign new teams each week by average.
Considerations:
- always between 2 to 5 teams depending on the total # of players each week
- we use "mystery" bowlers to even out teams (i.e. if there are 11 players, we have 1 mystery player as the 12th and have 4 teams of 3).
- mystery bowler can be called Mystery1 and Mystery2 depending on how many are needed (rarely 2)
- mystery bowler would be assigned an average that equals the assigned teams average
- if possible, ability to set # of teams (e.g. if we know we have 11 players, we set it to 3 teams of 4 OR 4 teams of 3 and then run the macro)
Example team below.
Player Overall Average Jack 185 Jill 158 Chris 149 Pete 172 Scott 159 John 154 Mihir 167 Sally 162 James 156 Hank 165 Perry 166
Thanks for any help, I have been struggling with this one for a long time!
Bookmarks