View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
A Mad Doberman A Mad Doberman is offline
external usenet poster
 
Posts: 22
Default Fantasy Football & Excel VBA

Hello All,

I have an application for fantasy football for which I'd like to use
Excel VBA.

First, you have to know a little about the setup.
I am joining a FREE auction league, for fun.
This league works a little differently than most leagues people here
may be involved with.

Each player has a certain "cost".
Each team owner (me) has a maximum amount he can "spend" on players.
Each player is projected to score a certain amount of points for the
year (my projections)
Each team owner is REQUIRED to have a specific number of players at
each position without going over the salary cap.

Here are those requirements.
Each team owner MUST have:
3 QB's (out of 50 choices)
5 RB's (out of 80 choices)
7 WR's (out of 100 choices)
2 TE's (out of 50 choices)
2 K's (out of 50 choices)
2 Def (out of 50 choices)

OK. I have made an excel sheet containing the name, cost, and projected
point total of every one of these players. What I'd like to do is cycle
through EVERY possible combination setup(yes...I know there would be
trillions of combinations) and check the following:

What is the total projected point value of the current possible team
combination?
What is the current cost of the current possible team combination?

Subject to the constraints:

If projected point value is less than the previously tested projected
point value, disregard combination.
If the cost of the current combination exceeds my salary cap, disregard
combination.

In the end, I'm of course looking for the most possible team points
(projected) without going over my salary cap.

I have a fair amount of excel VBA programming experience and I've
thought of these possible hangups regarding the code.

How to be efficient? It would be easy to write a code that ended up
testing the same combination many times, as you went through testing
loops. Given the number of combination, efficiency would be key.
How to set up a good looping structure given that positions 1-5 (of the
6 total) would be held stationary while position 6 was cycled and
combinations were tested. Then, one slight change would need to be made
in position 5 and position 6 would need to be cycled again. This would
occur until all of position 5 was cycled and then 1 slght change would
be made in position 4, etc.., etc...

I realize this will be quite a looping structure. If my math is right,
there are trillions and trillions of possible combinations. Is this
even practical? Can it work?