I have a Excel spreadsheet that consists of 6 worksheets. I include the following simply to provide a little background in preparation of asking a couple questions.
The worksheets are as follows:
My questions are:
The worksheets are as follows:
- Tennis Roster - max 20 players
- Schedule - For Tennis Doubles (i.e., 4 people needed to make up one match) where 13 weeks and max 4 courts are computed
- Allweeks - where player priorities are set based on many different variables (i.e., % of play, # of times played other players, days unavailable, days not scheduled to play previous week, etc.)
- TeamSelection1 - For court # 1, determines all combinations of matches based on available players (max 1820 if 16 players available, 4 at a time)
- TeamSelection2 - For court # 2, determines all combinations of matches based on available players (max 495 if 12 players available, 4 at a time)<strike></strike>
- TeamSelection3- For court # 3, determines all combinations of matches based on available players (max 70 if 8 players available, 4 at a time). Also, by default, identifies that final 4 players available to play on court # 4
Here's my problem:- For computing one simple day consisting of 3 courts and 12 players, the programs takes over 24 seconds to populate the schedule.
- In this example, the program will loop thru all potential combinations as follows:
- Group 1 - top 10 combinations
- Group 2 - top 5 combinations (i.e., based on four players being removed to play in first group
- Group 3 - top 1 combinations (i.e., based on four players being removed to play in first group<strike></strike>
- In this example, the program will loop thru all potential combinations as follows:
- For this program to compute all 13 weeks, it takes over 5 minutes to run. This is based on going through the list of potential players TWICE to ensure the best potential assignment of players to teams based on the criteria list above.
My questions are:
- Throughout the entire process, there is a lot of sorting, copying/pasting, placing values into arrays, etc. At no point, do I clear memory. Might this have an impact on the efficiency of the program and, if so, how do I go about clearing the memory?
- I also have a lot going on within the ALLWEEKS worksheet and the various TeamSelection worksheets (i.e., copying/pasting, sorting, lookups, etc.).
- Is it possible to perform all these functions while using an ARRAY thus improving efficiency? If the answer to this is YES then I will have a lot more research to do on this subject matter.
- I know you don't know the details behind any of the programming I have but if anyone has any other efficiency considerations that I should investigate that it would be appreciated.
Thanks for your thoughts on this matter.