0% found this document useful (0 votes)
28 views

Modeling Spreadsheet

Uploaded by

emilluiyy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Modeling Spreadsheet

Uploaded by

emilluiyy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

LGT5102 Models for decision making

Modeling with Spreadsheets


The Everglade Golden Years Co. Cash Flow
Problem

The (structured) Process of Modeling with
Spreadsheets
 Plan – build – test – analyze


Guidelines for Building “Good” Spreadsheet Models
 Easy to understand, easy to debug, easy to modify

Debugging a Spreadsheet Model
The Everglade Cash Flow Problem
• Their short-term cash flow requirements
cannot be met without borrowing.
Year Projected Net Cash Flow – initial balance: 1 million only
(millions of dollars)
– At least $0.5m reserve at all time
2024 –8
2025 –2
• A long-term (10 year) loan can be taken with
an interest rate of 5% (balloon payment of
2026 –4 entire principal)
2027 3 – lower interest
2028 6 • A series of short-term loans (1 year) can be
2029 3 taken with a projected interest rate of 7%
2030 –4 – flexible

2031 7
2032 –2 Question: Which loan (or combination of
2033 10 loans) should be taken, and in what
amounts, in order to maximize their cash-
2
balance position after 10 years?
The Process of Modeling

Visualize where you want to finish


Plan Do some calculations by hand

Computer program
Sketch out a spreadsheet analogy
– Spaghetti code
vs
– Structured code
Start with a Expand the model
Build small-scale model to full scale ●
Structured process
– Plan
– Build
– Test
Test Try different trial solutions to check the logic
– Analyze

Each includes
Evaluate proposed solutions and/or detailed steps.
Analyze optimize with Solver
3
If the solution reveals inadequacies
in the model, return to Plan or Build
Plan: Visualize Where You Want to Finish

• A common stumbling block in the modeling process occurs right at the


beginning — “How do I get started?”
• At this point it can be useful to ask the question — “Where do I want
to end up?” For example:
– What should the “answer” look like?
– What kinds of numbers need to be included in the recommendation?
– What information do I need to provide in a report?

• Example. What information is needed in the Everglade Cash Flow


problem (in the report)?
– Decisions (changing cells): which loan, what amount
– Results (output cells): projected cash balance each year (incl.
ending balance), interest payment, loan payback, etc.
Plan: Do Some Calculations by Hand

• Another common stumbling block arises when trying to enter a


formula in one of the output cells.
• At this point, it can be useful to do some calculations by hand.
– Just pick some numbers for the changing cells/decision variables and
determine what the results should be.
– Benefit: clarify what formula should be entered for an output cell;
help to verify the spreadsheet model.

• Suppose Everglade takes out a $6 million long-term loan and then


adds short-term loans of $2 million in 2024 and $5 million in 2025.
– How much cash will they have left at the end of 2024?
– How much cash will they have left at the end of 2025?
Plan: Sketch Out a Spreadsheet
LT Rate
ST Rate

Start Balance
Minimum Cash

Cash LT ST LT ST LT ST Ending Minimum


Flow Loan Loan Interest Interest Payback Payback Balance Balance
2024
2014
2025
2015
2026
2027
:
2028
2029
2030 >=
:
2031
2032
2033
2023
2034
2024


Elements: data cells, changing cells, output cells (interest
payments, ending balance, etc.), relations (=, int, bin, etc.) 6

Don't bother with numbers; concentrate on the layout.
Build: Start with a Small Version
• If the model is complicated, start with a small, readily manageable
version of the model.
• First make sure you’ve got the logic of the model worked out
correctly for the small version. Only then expand it to full size.
B C D E F G H I J K L
3 LT Rate 5%
4 ST Rate 7%
5
6 Start Balance 1 (all cash figures in millions of dollars)
7 Minimum Cash 0.5
8
9 Cash LT ST LT ST LT ST Ending Minimum
10 Year Flow Loan Loan Interest Interest Payback Payback Balance Balance
11 2014
2024 -8 6 2 1.000 >= 0.5
12 2015
2025 -2 5 -0.300 -0.140 -2.000 1.560 >= 0.5

F G H I J K L
8
9 LT ST LT ST Ending Minimum
10 Interest Interest Payback Payback Balance Balance
11 =StartBalance+SUM(C11:I11)>==MinimumCash
12 =-LTRate*LTLoan =-STRate*E11 =-E11 =J 11+SUM(C12:I12) >==MinimumCash
Test: Test Small Version (Full Version, later) of the Model
• Test the small (and manageable) model thoroughly.
– Check for dimensional consistency of units
– Try values of parameters and/or decision variables
– Retrospective test: Uses historical data to reconstruct the past,
– Use debugging tools, etc.

• Try values in the changing cells for which you know the answers (at
least approximately). Examples:
– All zeros
– All ones
– Very large numbers
– Numbers for which you’ve done hand calculations
• Expand the model to full size (copying formulas to the later years).
• Test the large model in a similar way.
Analyze: Analyze the Model (Before Solver)

9
Analyze: Analyze the Model (After Solver)

10
Guidelines for Building
“Good” Spreadsheet Models
• Enter the Data First
– Any spreadsheet model is driven by the data
– It is easier (and usually better) to build the model around the data
• Organize and Clearly Identify the Data
– Relevant data should be grouped (e.g. in tabular form)
– All data should be labeled
– Units should be identified
• Enter Each Piece of Data into One Cell Only
– Refer to the original data as needed
– This makes the model much easier to modify (only need to
change data in one place)
• Separate Data from Formulas
– Avoid putting numbers directly in formulas
– Put numbers in data cells and refer to them as needed
– This makes all data visible and easier to modify
• Keep It Simple
– Avoid “power functions” of Excel if possible
– Break out complicated formulas into subtotals
• Use Range Names
– Refer to data cells and blocks of cells using Excel’s range name feature
– Range names make formulas and the Solver model much easier to read
– Care must be taken not to overuse range names and to make sure they
remain correctly defined.
• Use Relative and Absolute References to Simplify Copying Formulas
– Whenever multiple related formulas will be needed, try to enter the formula
just once, and then use Excel’s fill commands to replicate the formula.
– This makes the model easer to build and also reduces typos.
• Use Borders, Shading, and Colors to Distinguish Cell Types
– For example:
– Data cells in blue (no border)
– Changing cells in yellow (regular border)
– Objective cell in orange (heavy border)

• Show Entire Model on Spreadsheet


– All data should be visible.
– All constraints should be shown on the spreadsheet (not buried in Solver),
preferably in three consecutive cells.
Three Tests for a “Good” Spreadsheet Model
Three tests:
• You should be able to immediately identify various types of
cells.
• All elements of the model should be visible on the spreadsheet
(including all constraints). You should not have to look in the
Solver dialogue box to figure out the model.
• Each equation should be simple enough that you can tell what
the equation is in each output cell without looking.

“Good” spreadsheet model


 Easy to understand, easy to debug, easy to modify
A Poor Spreadsheet Model
E
3 Ending
4 Balance
5 =1-8+C5+D5
6 =E5-2+D6-$C$5*(0.05)-D5*(1.07)
7 =E6-4+D7-$C$5*(0.05)-D6*(1.07)
8 =E7+3+D8-$C$5*(0.05)-D7*(1.07)
9 =E8+6+D9-$C$5*(0.05)-D8*(1.07)
10 =E9+3+D10-$C$5*(0.05)-D9*(1.07)
11 =E10-4+D11-$C$5*(0.05)-D10*(1.07)
12 =E11+7+D12-$C$5*(0.05)-D11*(1.07)
13 =E12-2+D13-$C$5*(0.05)-D12*(1.07)
14 =E13+10+D14-$C$5*(0.05)-D13*(1.07)
15 =E14+D15-$C$5*(1.05)-D14*(1.07)

Solver Parameters
Set Objective: EndBalance
To: Max
By Changing Variable Cells:

Where solution?
LTLoan, STLoan
Subject to the Constraints: ●
What constraints?
EndingBalance >= MinimumBalance

Solver Options:

Data? (Some in formulas!)
Make Variables Nonnegative
Solving Method: Simplex LP ●
Formulas understandable?
15
Debugging a Spreadsheet Model: The Toggle

Pressing control-~ toggles back-and-forth between showing values 16


and showing formulas in the spreadsheet.
Dependents of the LT Loan Cell

Choose “Formulas (Formulas Auditing)”, “Trace Dependents”; 17


removed by “Remove Arrows”
Precedents of the ST Interest (2025) Cell

Choose “Formulas (Formulas Auditing)”, “Trace Precedents”; 18


removed by “Remove Arrows”
Learning objectives


Understand and apply the general process for
modeling in spreadsheets

Understand and apply some guidelines for building
good spreadsheet
 Identify some deficiencies in a poorly formulated

spreadsheet model

Apply a variety of techniques for debugging (testing) a
spreadsheet model

19
Assignment


Review
 This slide, lecture notes (incl. review questions).


Assignment
 Problems in lecture notes.

 Submission: not required; solution will be distributed in

due course (available in Blackboard system).

20

You might also like