I have a fantasy football sheet set up that uses Solver to maximize projected points with a given spending limit. It selects 1 QB, 2 RB, 3 WR, 1 TE, 1 additional RB/WR/TE, and 1 DEF. This portion works fine.
Now I'm trying to add the following constraints built around the QB:
1) The QB and RBs can't be on the same team
2) The QB and only 1 of the WR must be on the same team
3) The QB and TEs can't be on the same team
I couldn't think of a quick and easy way to do this (if there is let me know), so I added additional columns for each team with a COUNTIF. If the player is on the team, it returns 1, otherwise it returns a 0. Then I created a section that gives the number of players for each team for each position using SUMPRODUCT. Then I had the SUMPRODUCT of the players from each team at 1 position with the players from each team at another position. See attached for a better description, highlighted in yellow. Saved as .xlsb to lower file size.
I thought this would work but I get the error that the linearity conditions are not satisfied (this is running Simplex). I switched to GRG and it takes forever to run then eventually says it couldn't be solved. Is there a simple way to do what I described?
Bookmarks