Modeling Spreadsheet
Modeling Spreadsheet
●
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
Start Balance
Minimum Cash
●
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)
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
●
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.
20