I have a spreadsheet where I need to run multiple solver scenarios. I would like to run a solver loop on varying iterations subject to my constraints. The problem becomes that most of the time solver does not come up with a feasible solution. Sometimes it does though.
Is there a macro that can run my iterations and saves all the feasible solutions for each iteration while moving on to the next iteration if there is no feasible solution? When I write “saves the feasible solution,” I mean that I can go back when it’s complete to see what “Changing Cells” and iterations were used that generated a feasible solution.
This way, I can kick off the macro, walk away for a few hours and come back to see all iterations completed, which would include a few feasible solutions. I guess the feasible solutions could be saved anywhere - new sheet or empty cells in the current sheet.
I have attached a dummy spreadsheet that has the gist of what I’m trying to do. Please don’t worry about the formulas. They were created just so a similar solver problem could be constructed in this dummy spreadsheet based on what I’m really working on. The formulas pull from the solver data, but don’t mean anything.
Solver Inputs:
Objective: Maximize Cell AN131
Changing Cells: H4:H5
Constraint: H1 >=3
Constraint: H2 >=7
Constraint: H4:H5 = integers ranging from 1-99
Constraint: AN132 > 0.14
Constraint: AN133 > 0.01
Solving Method: Evolutionary
The iterations I need to run are in cells G6 and G8. G6 should have a value of either 0 or 1. G8 should be integers of 1-10. So there will be 20 combinations… G6=0, G8=1; G6=1, G8=1; G6=0, G8=2; G6=1, G8=2; G6=0, G8=3; etc. (In reality, there are more combinations)
I’m running Excel 2010. If there is any information I’ve omitted that is needed, my apologies.
Each solver run takes about 5 minutes to run and knowing what’s ahead of me beyond this sheet, I’m guessing the entire project will take in excess of 30 hours. So… any help would be greatly appreciated!!!
If there is a better way to do this, I’m all ears. Thanks!
Bookmarks