Using Excel To Solve Linear Programming Problems: Example
Using Excel To Solve Linear Programming Problems: Example
Technology can be used to solve a system of equations once the constraints and
objective function have been defined. Excel has an add-in called the Solver which can
be used to solve systems of equations or inequalities.
There are two methods – one uses tables within the worksheet while the other uses only
the constraints. The second method is preferred when we know the constraints since it
is much faster!!!
B. Pollington
Formulas in cells:
Cell Formula
constraint a D15 = D6 + F6 + H6
constraint b D16 = 4.125*D6 + 8.25*F6 + 12.375*H6
constraint c D17 =30* D6 + 15*F6 + 45*H6
Maximize D19 =1.2* D6 + 2*F6 + 2.6*H6
Now that the table is set up, we can access the solver. Click on Tools. If you do not see
Solver then click on Add-Ins and select Solver. Now click on Tools again and select
Solver.
Target cell: Maximize cell. To enter it, just click on that cell.
Equal to Max
Changing Cells: Decision variable cells D6, F6, H6.
Subject to the constraints: Click on Add. Click on Cell Reference and then click in
D15, then click on Constraint and then click in F15. Be sure
the test listed between them is <=.
Now click on Options
Make sure Assume Linear Model and
Assume Non-Negative boxes are checked,
then click OK.
B. Pollington
The solutions are as shown:
two convenience stores
nine standard stores,
and
no expanded-services
stores.
Using a table to set up the problem makes the organization of data organized, but it has
one problem. All of this is time consuming! We can get the same results by just typing
in the constraints! The alternate format looks like this…
The first of the spreadsheet is done the same – typing in the variable assignments and
assigning decision variable cells. Next, we type the constraints which will be used as a
guide to type in the formulas in F9, F10, F11. They are the same formulas as in the
earlier spreadsheet – with different cell references. Finally, we type in the maximize
formula for reference and its formula in F13. We are now ready to access the Solver like
we did before. We should get the same results…
B. Pollington