You are on page 1of 18

Solving Linear

Programs in Excel

Prof. Ming-Jong Yao


National Yang Ming Chiao Tung University
myao@nycu.edu.tw
Introduction

This handout explains the use of Excel Solver for


solving Linear Programming problems.
The hyperlinks of the references
http://www.msubillings.edu/asc/resources/math/Tutorial
s/FiniteMathHelps/Lin%20Prog%20with%20Excel.pdf
http://www.excel-easy.com/data-analysis/solver.html

National Yang Ming Chiao Tung University 2 Prof. Ming-Jong Yao


Enabling Solver in Excel
Go to options:

National Yang Ming Chiao Tung University 3 Prof. Ming-Jong Yao


Enabling Solver in Excel
Select Add-In:

National Yang Ming Chiao Tung University 4 Prof. Ming-Jong Yao


Enabling Solver in Excel

Click on 'Go' button, check


Solver Add-in, click OK:

You should be able to see the


Solver button in your Excel
Data Ribbon:

National Yang Ming Chiao Tung University 5 Prof. Ming-Jong Yao


Sample Problem 1

a. What are the decisions to be made? For this problem, we


need Excel to find out how much to order of each
product (bicycles, mopeds and child seats).
b. What are the constraints on these decisions? The
constrains here are that the amount of capital and storage
used by the products cannot exceed the limited amount
of capital and storage (resources) available. For example,
each bicycle uses 300 units of capital and 0.5 unit of
storage.
c. What is the overall measure of performance for these
decisions? The overall measure of performance is the
total profit of the three products, so the objective is to
maximize this quantity.
National Yang Ming Chiao Tung University 6 Prof. Ming-Jong Yao
Formulate linear programming model

National Yang Ming Chiao Tung University 7 Prof. Ming-Jong Yao


Formulate linear programming model

To make the model easier to understand, name the


following ranges

Range Name Cells


UnitProfit C4:E4
OrderSize C12:E12
ResourcesUsed G7:G8
ResourcesAvailable I7:I8
TotalProfit I12

National Yang Ming Chiao Tung University 8 Prof. Ming-Jong Yao


Formulate linear programming model

Insert the following three SUMPRODUCT functions.

 Explanation: The amount of capital used equals the sumproduct of the range
C7:E7 and OrderSize. The amount of storage used equals the sumproduct of the
range C8:E8 and OrderSize. Total Profit equals the sumproduct of UnitProfit
and OrderSize.
National Yang Ming Chiao Tung University 9 Prof. Ming-Jong Yao
Solve the Model

1. On the Data tab, click Solver.

National Yang Ming Chiao Tung University 10 Prof. Ming-Jong Yao


Solve the Model

 Enter the solver


parameters (read
on).
 The result should be
consistent with the
picture on the right.

National Yang Ming Chiao Tung University 11 Prof. Ming-Jong Yao


Solve the Model

You have the choice of typing the range names or


clicking on the cells in the spreadsheet.
2. Enter TotalProfit for the Objective.
3. Click Max.
4. Enter OrderSize for the Changing Variable Cells.
5. Click Add to enter the following constraint.

National Yang Ming Chiao Tung University 12 Prof. Ming-Jong Yao


Solve the Model

6. Check 'Make Unconstrained Variables Non-


Negative' and select 'Simplex LP'.
7. Finally, click Solve.
Result:

National Yang Ming Chiao Tung University 13 Prof. Ming-Jong Yao


The Optimal Solution

Conclusion: it is optimal to order 94 bicycles and 54


mopeds. This solution gives the maximum profit of
25600. This solution uses all the resources available.

National Yang Ming Chiao Tung University 14 Prof. Ming-Jong Yao


Sample Problem 2

A company manufactures desks and chairs. Each desk


uses 4 units of wood, and each chair 3 units of wood.
A desk contributes $40 to profit and a chair contributes
$25.
Marketing restrictions require that the number of chairs
produced to be at least twice the number of desk
produced.
There are 20 units of wood available. What set of
production will bring maximum profit.

National Yang Ming Chiao Tung University 15 Prof. Ming-Jong Yao


Sample Problem

 Unitstoproduce is
the range C18:C19.
totoalwoodused is
the name of cell
F20.

National Yang Ming Chiao Tung University 16 Prof. Ming-Jong Yao


Sample Problem
Solver setting
Give 1 in green cells
as initial values.
Solver should be
able to give you the
correct values for
them.

National Yang Ming Chiao Tung University 17 Prof. Ming-Jong Yao

You might also like