Excel Solver-An Optimization Tool
Excel Solver-An Optimization Tool
AN INTRODUCTION TO EXCEL
SOLVER – AN OPTIMIZATION
TOOL
([FHOVROYHULVDQRSWLPL]DWLRQWRROZKLFKFDQEHXVHGWRÀQGVROXWLRQRU
make decision on real life business problems, where we want to arrive at
decision either based on maximum or minimum value of something. For ex-
DPSOHSURÀWFRVWUHWXUQRQLQYHVWPHQWHWF8VLQJ([FHO6ROYHULVHDV\DQG
VLPSOH,WFDQEHXVHGWRDQVZHUSUREOHPVZKLFKRWKHUZLVHVHHPVGLIÀFXOWRU
time consuming. This article provides an insight into this tool.
M icrosoft Excel
Solver is an op-
timisation tool,
inbuilt provided into Ex-
cel. This tool can be used
LQJ SUREOHPV· ¶ÀQDQFLDO SODQ-
ning problems’, ‘retirement
planning problems’, and ‘work-
force scheduling problems’.
to solve practical business 8VLQJ ([FHO 6ROYHU LV HDV\ DQG
problems like ‘optimum — CA. Liyakatali Lal simple. It can be used to answer
product mix problems’, (The author is a Member of the Insti- problems which otherwise seem
tute. He can be reached at liyakatali_
‘transportation or distribu- [email protected]) GLIÀFXOWRUWLPHFRQVXPLQJ
*R!!&KHFN6ROYHU$GGLQ!!2.$IWHULQVWDOOD- available.
WLRQJRWR'DWDWDELQULEERQ!!6ROYHU
:H FDQ
W SURGXFH PRUH WKDW LWV GHPDQG EHFDXVH
([FHO7RRO!!$GG,QV!!&KHFN6ROYHU$GG the excess production is wasted (for example, a per-
LQ!!2.$IWHULQVWDOODWLRQ7RRO!!6ROYHU ishable drug).
/HW
VVROYHWKHIROORZLQJH[DPSOHRI WKHSURGXFWPL[
SUREOHP 6D\ ZH ZRUN IRU D )0&* FRPSDQ\ WKDW
produces six different products at their plant. Produc-
tion of each product requires.
*RUE\XVLQJ 680352'8&7%*%* Click the Options button in the Solver Parameters
6LPLODUO\ UDZ PDWHULDO XVDJH FRXOG EH FRPSXWHG DV dialog box. Check Assume Linear Model box and As-
%
%&
&'
'(
()
)*
* sume Non-Negative box as shown below. Click OK.
RUE\ 680352'8&7%*%*(QWHULQJ
formula in traditional fashion for six products is time-
consuming. Imagine how long it would take if we are
ZRUNLQJZLWKDFRPSDQ\WKDWSURGXFHGSURGXFWV
:H FDQ QRZ LGHQWLI\ WKH WKUHH FRPSRQHQWV RI RXU
product mix solver model:
1. Target cell - Our goal is to maximize prof-
LW LQ FHOO % FRPSXWHG E\ IRUPXOD DV
680352'8&7%*%*
&KDQJLQJFHOOV7KH4W\SURGXFHGRI HDFKSURG-
uct (listed in the cell range B4:G4)
3. Constraints - We have the following constraints:
z Do not use more of labour or raw material
than available i.e. values in cells B13:B14 (used)
must be less than or equal to the values in cells
D13:D14 (available).
z Do not produce more of a drug than its de- Figure 4 : Solver option settings
mand i.e. values in the cells B4:G4 (produced) Checking the Assume Non-Negative box ensures
must be less than or equal to the value in cell that changing cell assumes a non-negative value. We
B3:G3 (demand). checked the Assume Linear Model box because this is
z :H FDQ
W SURGXFH D HLWKHU SDUWLDO RU QHJDWLYH DOLQHDUSUREOHP(VVHQWLDOO\D6ROYHUPRGHOLVOLQHDU
4W\RI DQ\SURGXFW under the following conditions:
Now enter the target cell, changing cells and con- 7KHWDUJHWFHOOLVFRPSXWHGE\DGGLQJWRJHWKHU
straints into Solver. Then click the Solve button to WKHWHUPVLQIRUPFKDQJLQJFHOO
FRQVWDQW
ÀQGDSURÀWPD[LPL]LQJSURGXFWPL[6ROYHUSDUDP- (DFKFRQVWUDLQWLVHYDOXDWHGE\DGGLQJWRJHWKHU
eter dialog box will look like WKHWHUPVLQIRUPFKDQJLQJFHOO
FRQVWDQW
6LQFHRXUSURGXFWPL[SUREOHPLVDOLQHDUPRGHOZK\
should we care?
1. If a Solver model is linear and we select As-
sume Linear Model, Solver is guaranteed to
ÀQGWKHRSWLPDOVROXWLRQWRWKH6ROYHUPRGHO
,I D6ROYHUPRGHOLVQRWOLQHDU6ROYHUPD\RU
PD\QRWÀQGWKHRSWLPDOVROXWLRQ
2. If a Solver model is linear and we select As-
VXPH/LQHDU0RGHO6ROYHUXVHVDYHU\HIÀFLHQW
DOJRULWKP WKH VLPSOH[ PHWKRG WR ÀQG WKH
PRGHO
V RSWLPDO VROXWLRQ ,I D 6ROYHU PRGHO
is linear and we do not select Assume Linear
0RGHO6ROYHUXVHVDYHU\LQHIÀFLHQWDOJRULWKP
WKH*5*PHWKRGDQGPLJKWKDYHGLIÀFXOW\
ÀQGLQJWKHPRGHO
VRSWLPDOVROXWLRQ
After clicking OK in the Solver Options box, we re-
turn to the main Solver parameter dialog box, shown
earlier in Figure 3. When we click Solve, Solver calcu-
Figure 3 : Final dialog box for product mix problem
lates an optimal solution (if one exists) for our prod- tribution cost
uct mix problem. An optimum solution calculated in &KDQJLQJFHOOV7KH4W\SURGXFHGDWHDFKVXS-
)LJXUH SO\SRLQWDQGVKLSSHGWRHDFKGHPDQGSRLQW
&RQVWUDLQWV 7KH 4W\ VKLSSHG IURP HDFK
VXSSO\SRLQWFDQ
WH[FHHGSODQWFDSDFLW\(DFK
demand point must receive its required de-
mand. Also, each changing cell must be non
QHJDWLYHDQGDQLQWHJHUQXPEHU3DUWLDO4W\
cannot be shipped)
If XYZ Textile Ltd produces textile at three different
Available ORFDWLRQVDQGGLVWULEXWHWRIRXURXWOHWVKRZFDQWKH\
minimize the cost of meeting demand for them?
/HW
VQRZVROYHWKHIROORZLQJH[DPSOHRI WKH7UDQV-
portation problem.
)LJXUH2SWLPXPVROXWLRQRI SURGXFWPL[ZLWKLQ
constraint
2XU)0&*&RPSDQ\FDQPD[LPL]HSURÀWRI
E\ SURGXFLQJ XQLW RI 5 XQLWV RI 6 DQG
units of T. We can be sure that with our limited re-
VRXUFHVDQGGHPDQGWKHUHLVQRZD\WRPDNHPRUH
WKDQ
Is it necessary that Solver model always have a
IHDVLEOHVROXWLRQ" 680((
5HFHLYHG 6HQW 4W\ LV
FDOFXODWHG E\ XVLQJ 680
function
7KHDQVZHULV´1Rµ6D\LQRXUH[DPSOHGHPDQGIRUHDFK
product must be met. Demand constraint will change from
)LJXUH )HDVLEOH VROXWLRQ QRW RSWLPXP ZLWKLQ
%* %*WR%*! %*6ROYHUUHVXOWJLYHV
constraints
PHVVDJHDV´6ROYHUFRXOGQRWÀQGDIHDVLEOHVROXWLRQ
This message means that with our limited resources, we :HFDQQRZLGHQWLI\WKHWKUHHFRPSRQHQWVRI 7UDQV-
FDQ
WPHHWGHPDQGIRUDOOSURGXFWV portation Solver model:
What if Solver result gives the message as “The 1. Target cell - Our goal is to minimise Total ship-
VHWFHOOYDOXHVGRQRWFRQYHUJHµ" PHQW FRVW LQ FHOO & FRPSXWHG E\ XVLQJ IRUPXOD
680352'8&7%(%( RU FDQ DOVR EH
/HW
VVHHZKDWKDSSHQVLI ZHDOORZXQOLPLWHGGHPDQG
FDOFXODWHGLQWHGLRXVIDVKLRQDV %
%&
&
for each product, delete demand constraint and we
'
'(
(%
%&
&'
'(
DOORZQHJDWLYH4W\WREHSURGXFHGFOHDUWKH$VVXPH
(%
%&
&'
'(
(
Negative box. When we click Solve, Solver returns the
PHVVDJH 6HW &HOO 9DOXHV 'R 1RW &RQYHUJH 7KLV >1RWH 7KH 680352'8&7 IXQFWLRQ FDQ PXOWL-
means that our model has an error. SO\FRUUHVSRQGLQJHOHPHQWLQWZRVHSDUDWHUHFWDQJOH
(both rectangle are of the same size) and add together
%7UDQVSRUWDWLRQRU'LVWULEXWLRQ3UREOHPV
the product.]
0DQ\ FRPSDQLHV PDQXIDFWXUH SURGXFWV DW GLIIHUHQW
&KDQJLQJFHOOV7KH4W\SURGXFHGDWHDFKVXSSO\
ORFDWLRQV 6XSSO\ SRLQW DQG VKLS WKHLU SURGXFWV WR
point (Factories) and shipped to each demand point
customers (Demand points). A question then is, what
(Outlet), (listed in the cell range B12:E14).
LVWKHOHDVWH[SHQVLYHZD\WRSURGXFHDQGVKLSSURG-
XFWVWRFXVWRPHUVDQGVWLOOPHHWGHPDQG"7KLVW\SHRI 3. Constraints - We have the following constraints:
problem is called a transportation problem. A trans- z 'R QRW VKLS IURP HDFK )DFWRU\ PRUH WKDQ
portation problem is a linear model with the following SODQW FDSDFLW\ LH YDOXHV LQ FHOOV ))
VSHFLÀFDWLRQV (Sent) must be less than or equal to the values
1. Target cell - Minimize total shipping and dis- LQFHOOV++FDSDFLW\
NRZOHWXVVROYHWKLVSUREOHPE\LGHQWLI\WKHWKUHH Since our model is linear, we will also check the As-
components of capital budgeting model: sume Linear Model and Assume Non-Negative boxes
XQGHU2SWLRQ)LQDOO\&OLFN6ROYH6ROYHUZLOOFDlculate
1. Target cell - Our goal is to maximise To-
an optimal solution for our capital budgeting prob-
WDO 139 LQ FHOO ( FRPSXWHG E\ XVLQJ IRUPXOD lem. An optimum solution calculated in Figure 12.
680352'8&7$$&& WKLV IRUPXOD
RQO\SLFNVXS139RI SURMHFWZLWKLQFROXPQ
A and doesn’t consider NPV with 0 in column
A. It can also be calculated in tedious fashion
E\PXOWLSO\LQJELQDU\YDULDEOHLQFROXPQ$ZLWK
139 YDOXHVLQ FROXPQ & HYHU\ URZ ZLVH DQG
adding together for all projects to arrive at total
139ÀJXUH
&KDQJLQJFHOOV:HORRNIRUDRUELQDU\
changing cell for each project (listed in A3:A12).
Here, 1 = Do the project and 0 = don’t do the
project.
3. Constraints - We have the following con-
straints:
z Do not use capital and labour more
WKDQ DYDLODEOH LQ HDFK \HDU LH YDO-
XHV LQ FHOOV (+ 8VHG PXVW
be less than or equal to the values
Figure 12 : Optimum solution - maximum NPV with-
LQ FHOOV (+ $YDLODEOH 8VHG FDSLWDO
in constraint
DQG ODERXU LV FRPSXWHG E\ XVLQJ IRUPXOD
680352'8&7$$ (( 6RIWZDUH/WGFDQREWDLQPD[LPXP139RI E\
DQG FRS\IURP (+ VLJQ LV XVHGIRU VHOHFWLQJSURMHFWDQG
absolute cell referencing). D. Financial Planning:
z Values of changing cell listed in A3:A12 7KH6ROYHUIHDWXUHLQ0LFURVRIW2IÀFH([FHOFDQEH
VKRXOGEH%LQDU\ XVHGDVDSRZHUIXOWRROIRUDQDO\]LQJÀQDQFLDOSODQ-
QLQJSUREOHPVOLNHKRZPXFKPRQH\,QHHGWRVDYH
After entering the target cell, changing cells and con-
IRUUHWLUHPHQW"2UKRZVKRXOG,DOORFDWHP\LQYHVW-
straints into Solver. Solver parameter dialog box will ment portfolio among Govt. bond, blue chip stocks,
look like speculative stocks and short term deposits?
/HW
VORRNDWWKHH[DPSOHLQ)LJXUHZHKDYHWRWDO
fund of 20 Lakhs to invest in among 4 options within
following constraints:
z :HLJKWHGDYHUDJHULVNIDFWRUQRWWRH[FHHG
z Amt in speculative stocks should not exceed
20% of total amount invested
z At least 2 Lakhs to be invested in short term
deposits
z ,QYHVWPHQW LQ DQ\ RSWLRQ VKRXOG EH ZKROH
number i.e. fraction of rupee cannot be in-
Figure 11 : Final solver dialog box with constraint YHVWHGLQDQ\RSWLRQ
)LJXUH2SWLPXPVROXWLRQZLWKLQFRQVWUDLQWVIRU Conclusion:
Investment planning
Excel solver is an optimization tool which can be used
0D[LPXPDQQXDOUHWXUQRI FDQEHREWDLQHG WRÀQGVROXWLRQRUPDNHGHFLVLRQRQUHDOOLIHEXVLQHVV
E\LQYHVWLQJLQ*RYWERQGLQ%OXH problems, where we want to arrive at decision either
chip stocks, 4 Lakhs in Speculative stocks and 2 Lakhs based on maximum or minimum value of something.
in Short term deposits. )RUH[DPSOHSURÀWFRVWUHWXUQRQLQYHVWPHQWHWF