Unique question about running solver multiple times

Ben2125

New Member
Joined
Jan 22, 2018
Messages
9
I have a spreadsheet for playing daily fantasy basketball; in this spreadsheet, I have the players' names, salaries, and projected fantasy points. I have set up solver to find the optimal lineup each night (highest projected fantasy point total) that fits in the constraints I have set. However, instead of only finding the top lineup each night, I want to run the optimizer to find the top "n" (n being a number I set Ex.10) number of lineups. The objective of the solver is to maximize the cell "AI2". I am not really sure how to find the top "n" number of lineups. I was thinking of running the solver once (giving me the maximum fantasy point total lineup) and then setting the goal to be the value of the same cell (AI2) subtracted by 2.5. I think this would ensure that I would get 10 different lineups at different intervals of score. Furthermore, I would like to have a separate sheet or range on the same sheet where excel automatically pastes in each of the lineups it creates. The problem with this whole task is that (1) I have no clue how I would create this loop in VBA), and (2) I don't know if this would even accomplish what I want excel to do. My VBA skills are extremely limited so I was hoping someone could help me out with some sample code to create the 10 optimal lineups and paste them in a table. I have looked online to see if anyone has answered my case about running solver multiple times, but all the threads I come across seem to rely on changing the objective cell's range (I just want the value in the same cell to change each time). Also, this may be incredibly complicated but I also wanted to know how, and if, I could set up a solver that factors in player exposures (Ex. LeBron James only appears in 50% of lineups). Finally, I was wondering if maybe this task would be better accomplished outside of excel, like by creating a program in python (or something like that). Any feedback/responses are much appreciated. Thanks.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top