Professional Documents
Culture Documents
Financial
Modelling
in Excel 2010
Manual
This document is the property of Celsoft Corporation and is meant for the participants of
Celsoft Training Workshops only. Any use or reproduction of this manual without the
authority of Celsoft is strictly prohibited.
Financial Modelling in Excel (v2007) © Celsoft Corporation
CONTENTS
2
Financial Modelling in Excel (v2007) © Celsoft Corporation
FINANCIAL MODELLING
Objectives
Understanding what financial modeling is and what it involves.
Understanding the importance of the modeling course to our jobs.
Understand the financial modeling life cycle in detail.
1. INTRODUCTION
FINANCIAL MODELLING is the practice of distilling numerical data with predictive insights and
business logic to derive answers to business questions.
FOR EXAMPLE
In a planning and forecasting situation for a Treasury Department of a financial institution, the
model might start with an analysis of the portfolio for measures such as:
• margins by product,
• deposits by sector,
• concentration ratios,
• gap analysis,
• risk analysis
3
Financial Modelling in Excel (v2007) © Celsoft Corporation
This will be followed by predictive insights of economic measures and expectations of the
department e.g.
• Forecast interest rates;
• Forecast inflation rates;
• Forecast market liquidity;
• Expected GDP;
• Forecast balance of payments and exchange rates;
• Dealing strategy for the company etc,
These factors will be integrated in a robust financial model to forecast the expected treasury
income, liquidity, balance sheet and to allow Treasurers to do what-if analysis and sensitivity
analysis to guide Treasury strategy.
Modelling can be done by employing various types of software e.g. Spreadsheets, Quantrix etc.
In this training session, our focus shall be on spreadsheet modelling.
WHY MODELLING
Necessary Skill - The use of Excel is a core skill for managers and non-managers because most
work now require the use of spreadsheets.
No formal Training - However, few users receive formal training in modelling techniques and
the use of Excel.
Powerful tool - Excel is a powerful tool, which can help automate a number of processes as
well as guiding decision-making.
No professionalism & Standardization - Since the introduction of spreadsheet model
development has not taken any formal shape since users have not yet regarded modelling as a
profession which can actually be standardized.
4
Financial Modelling in Excel (v2007) © Celsoft Corporation
The templates are not reliable as you can see circular references, errors and some formulas that
you can’t follow and some parts having been deleted.
Inputs and formulas are combined and not protected to prevent accidental deletions.
Not useable by another person who has not developed them.
No deliberate action by organizations to set up models or modelling units/departments. Very
important decisions are made without the use of a computer model.
No deliberate plan to train staff in financial modelling.
2. SPREADSHEET MODELLING
SPREADSHEET MODELLING is a generic term that is used to describe any form of analysis
which is undertaken using spreadsheets. Spreadsheet modelling is also commonly referred to as
‘financial modelling’ or simply ‘modelling’.
The spreadsheet is a powerful tool used by almost every organization and nearly every business
decision of any importance is backed up with a spreadsheet model of the financial projections.
But there is a big difference between the best and worst examples of spreadsheet modelling.
It has been established through research that, for major transactions with large sums of money
at stake, most modellers have no formal training in good modelling techniques and that their
organizations do not have even the most rudimentary internal standards.
What can you do? The answer is by taking steps to understand and control the process of
spreadsheet development, define the objectives and calculations, design the spreadsheet so that
it is easy to understand, test the results and use your model effectively you can achieve much
more with your spreadsheet.
Nowadays spreadsheets are being replaced by better, multi-dimensional modeling software like
the leading Quantrix Modeler developed by Quantrix in America. Visit www.quantrix.com for
more.
5
Financial Modelling in Excel (v2007) © Celsoft Corporation
Spreadsheet modelling is a relatively new area of expertise within the business world. Functional
spreadsheet applications were first developed in the 1980s with the release of Lotus 1-2-3.
Microsoft Excel® for Windows was released in 1987 but it was not until the release of Microsoft
Excel 95® that spreadsheet applications became widely used within the business world. Since
the release of Microsoft Excel 95®, spreadsheet application functionality has improved at an
exponential rate, providing spreadsheet model developers with the tools to construct increasingly
sophisticated spreadsheet models.
With the rise of spreadsheet application technology, both simple and complex spreadsheet
models have become more prevalent throughout the business world. Spreadsheets are now
generally accepted as being the primary vehicle for modelling in business.
The demand for spreadsheet modelling continues to rise, with decision makers relying more
intensively on spreadsheet modelling analysis as the basis for their decisions. In order to meet
the increasingly complex demands of model users, model developers have had to significantly
improve their spreadsheet modelling skills. As such, spreadsheet model development has become
a highly skilled area of expertise within the business community.
3. TYPES OF MODELS
There are different types of models but in this manual, we will focus on the simple classification
of models into the following types:
Complex Models
For complex modelling problems, but where there is a good understanding of the problem that is
being modelled and there is adequate time for the development of an appropriate model.
Applying each of the six stages helps to ensure the development of a robust model, reducing the
risk of errors and getting the most from the modelling process.
Examples of types of models that fall into this category are long term financial planning or
forecasting models that will be developed once and used many times.
6
Financial Modelling in Excel (v2007) © Celsoft Corporation
Simple Models
The principles of good spreadsheet design apply equally to the simplest or most complex of
models.
Examples of simple models are ones that take only a day of two to complete, or models that are
used only by the developer for his or her own thought process.
Deterministic
This is the most common type of model, and allows for specific data input with results defined by
formulas. A change to the input data will result in a change to the calculated results. Generally,
changes can be made backwards and forwards. “Forward” changes are commonly known as
“what-ifs” (i.e. changes to input data), and backward changes are known as “Goal seeks”
Optimization
This is linear programming. A model is defined with sets of constraints (e.g. “only 40 hours are
available”) and then manipulates the input data in line with the constraints to either maximize or
minimize a result.
7
Financial Modelling in Excel (v2007) © Celsoft Corporation
All computer models go through different stages of development, but the accessibility and ease
of use of spreadsheet packages sometimes make it easy for these stages to become blurred.
Experience of the way that models grow and evolve will help you develop better models.
SCOPE
This stage is where we assess the nature, scale and complexity of the model required. During the
scope stage you should:
• Define the objectives of the model (Decide what needs to be included in the model and
what can be omitted). Some model features may be left for complexity and time
challenges or may be left for future considerations as add-ons.
• Consider the level of detail required in the input and logical assumptions (complexity).
The scope stage is the time to make sure that you understand, at least in broad terms,
what data is required for the model and how you are going to obtain it.;
• Estimate the time and resource required for the model development; and
8
Financial Modelling in Excel (v2007) © Celsoft Corporation
SPECIFY
• Try to avoid letting the availability of input data determine the output that you produce.
The model objectives should drive the results required, the results should drive the
calculations and the calculations should drive the required inputs.
• In short, the specify stage involves defining the model results, calculations and inputs.
Calculations can be defined by drawing a simple bubble diagram as shown below:
9
Financial Modelling in Excel (v2007) © Celsoft Corporation
Interest rate %, 2dp % One entry Policy Must be > 0. Finance The rate applied
only. variable. dept. on any overdraft
balances.
Sales Numeric 000's units One entry Forecast Must be > 0. Marketing
per month. dept.
Debtor period Numeric Days One entry Estimated Must be > 0; Finance
only. from budget must be < dept.
data. model period.
Asset life Numeric Years One entry Policy Must be > 10. Finance Calculated on a
only. variable. dept. straight line
basis.
10
Financial Modelling in Excel (v2007) © Celsoft Corporation
Sale price including VAT = Sale price excluding VAT × 1.175 assumes that the VAT rate is
17.5%. It works fine, until the VAT rate changes.
To avoid having to search through every formula in the model for calculations which assume the
VAT rate, set up an input cell for the VAT rate and refer to that instead. For a single cell of this
sort, it is useful to create a range name, say “VAT rate”, so instead of typing the constant you
use the formula:
Sale price including VAT = Sale price excluding VAT × (1 + VAT rate)
If there is any change to the input assumption, or you want to run sensitivity, the constant can
be changed throughout the model instantly. Even if the constant never changes, the new formula
is much simpler to read and understand.
DESIGN
• The design stage involves producing the most effective structure for the model. By following
some key guidelines it is possible to make your spreadsheet models significantly easier to use
and less prone to errors.
11
Financial Modelling in Excel (v2007) © Celsoft Corporation
• Before you design a spreadsheet, make sure that a spreadsheet is the most appropriate tool for
the job. For example where multi-dimensions are required, spreadsheets which are two
dimensional, will not be able to do the job.
• Discipline in the spreadsheet design is even more important to create easy to understand
spreadsheet models.
• Inputs to a model should be placed on a separate part of the worksheet from calculations. It is
also a good idea to place those results which are produced by the model in a separate place from
intermediate calculations.
• Separating inputs helps to avoid confusion in using and maintaining models. It reduces the risk
that parts of the input data are overlooked or that calculations are overtyped with input figures.
Inputs should be separated physically on the sheet, but can also be separated by clear labeling
and colouring of the spreadsheet.
• When using multiple sheets, it can be a good idea to maintain a single sheet containing all of the
model inputs in one place. So, whenever an input assumption needs to be changed, the user
always knows where to go to look for it.
• An alternative design is to place inputs at the top of each sheet which requires them. This keeps
inputs fairly close to the calculations in which they will be used, while keeping them separate
from the calculation.
12
Financial Modelling in Excel (v2007) © Celsoft Corporation
• quicker development, because every formula can be written in a single column, then
copied across;
• effective testing;
• robust updating and maintenance, because every time you change a formula in a cell you
know that it should be copied across the rest of the row; and
• straightforward documentation, in a specification which has one definition for each row
of the final model.
For some problems, producing a design with only one formula per row requires some careful
thought. But the benefits of the design far outweigh the extra work required.
13
Financial Modelling in Excel (v2007) © Celsoft Corporation
blank out the relevant sections for other subsidiaries. Do not delete any rows or columns, so that
the common elements on the different worksheets can still be edited together.
Rule 5: Use each column for the same purpose throughout the model
However many worksheets you use, it is good practice to always use the same layout for
columns on all worksheets.
For a financial model, an example column layout might be:
Columns A. and B. Units
Always using the same column for the same purpose makes the model easier to build and
reduces some of the risks of errors. For example: if January 2001 is always in column X then you
know that every formula that refers to January 2001 will also refer to column X.
Colour coding
Colour coding is a useful technique to make spreadsheets easier to use. Examples of using colour
coding include:
• separating inputs from calculations, by making all of the cells requiring inputs the same
colour;
14
Financial Modelling in Excel (v2007) © Celsoft Corporation
• separating types of inputs, such as by making the inputs required from the finance
department one colour and those required from the marketing department another
colour;
• highlighting cells which are linked to external spreadsheets; and
Units
It is important to use clearly define summarization levels for inputs to a model, e.g., ZMK000 or
ZMK millions.
Formulae in English
For simple models, with little formal documentation, it can be useful to include an extra column
containing natural language ‘translations’ of the formulae in the model.
This helps to make the calculations in a model easy to understand, makes important logical
assumptions more transparent to anyone using the model and makes it possible for an
independent tester to check the coding in the model.
There are two ways of achieving this: Firstly by naming ranges and secondly by providing an
extra column that describes the formulae in English.
When the model development is complete, the column containing the formula can be safely
hidden, but not deleted to keep it as a record of what the model is attempting to do.
BUILD
The build stage is where the actual coding of the model takes place. Many spreadsheet models
start their life cycle here with only scant regard to the three stages outlined above.
This leads to:
• A model that is more complex than originally expected and takes longer to build;
• Assumptions being made that were not part of the original brief; and
15
Financial Modelling in Excel (v2007) © Celsoft Corporation
By breaking your calculations into a series of steps you make them easier to understand and
reduce the chances of making an error. In most models, the intermediate steps introduced here
are worth including for use in other calculations.
Built in features
When a model is going to be used over a long period of time, especially if it is to be used by a
large number of people, Excel provides a number of facilities to make your spreadsheet more
robust. For example, you can:
• use cell protection to protect formulae in the model from being overtyped, while still
allowing input values to be changed;
• use the data validation feature, such that an error message will appear if inputs lie
outside a valid range.
TEST
To test a model is to root out errors and inconsistencies and to increase confidence in the results
that the model produces.
16
Financial Modelling in Excel (v2007) © Celsoft Corporation
While it is never possible to test a complex model to the extent that you can guarantee it to be
error free, this stage does provide the confidence that the model is producing reliable results.
Errors at this stage can undermine the credibility of both the model and its developer. The value
of testing can be measured against the potential cost of a wrong decision: if a model is being
used for an important and expensive business decision, the time and resource spent testing the
model is time and money well spent.
Testing should always be carried out by an independent third party.
Testing should be carried out by the developer during building and by an independent tester
after building but before use.
Types of tests are:
• Specification test – checking if model meets specifications.
• Formula tests –checking if formulae are calculating results properly
• Numeric tests- Re-computing the results and comparing with test results. Also involves
checking the validity of assumptions. Egg 120% margin is an invalid assumption.
• Robustness Test -The tester needs to consider all of the feasible circumstances under
which the model may be used in future. This includes doing an environment check where
one checks the ability of the model to work on a particular computer, memory or
network. Also involves boundary tests which check the behaviour of the model when
inputs reach sensible limits or checking if typing zeros in assumptions produce errors.
• Macro tests – Checking if all macros and buttons are working effectively.
17
Financial Modelling in Excel (v2007) © Celsoft Corporation
Common errors
With experience, you can learn to spot many of the most common spreadsheet errors very
quickly.
• Forgetting to copy the new formula across into the other cells in the row.
Wrong reference
• Nearly every formula in a spreadsheet refers back to another input or calculation. With the
quantity of references in any large spreadsheet, it is inevitable that you will make mistakes
and refer to the wrong cell.
• A similar mistake is to include the wrong cell reference in a SUM formula. It is particularly
easy to introduce this error when you insert an extra row in a block of cells that are being
summed. Insert a row in the middle of the block, and the formula will automatically adjust to
include the extra row, but insert a row immediately above or below the block and the new
row will be omitted.
• Another commonly found error is caused by confusion between relative and absolute
references. Remember that a cell reference in a formula of the form ‘=D4’ will change if you
copy the formula across the row to E4, F4 and so on. Copied down a column it will change to
D5, D6, etc. If you use the reference ‘=$D$4’ it will not change when copied across or down.
You can also use semi-absolute references of the form $D4 or D$4.
• One technique to help avoid making this mistake is by following the fifth golden rule of
spreadsheet design, by using each column for the same purpose throughout the
spreadsheet. If you always use column D for constants, you know that every formula that
refers to column D should contain an absolute reference, such as $D$4, while references to
others columns should always be relative, for example E3.
18
Financial Modelling in Excel (v2007) © Celsoft Corporation
Unit errors
Mixing up the appropriate units for the elements in a calculation is another frequently occurring
problem. Especially common is confusion between the order of magnitude for inputs, such as £s
versus £000s.
USE
A best practice spreadsheet model is a powerful tool, but to realize its usefulness you need to
understand how to:
• Present useful information to help make decisions, not just print out numbers;
• Present sensitivities and scenarios to understand the important drivers in the business;
and
• Control the evolution of the model when further changes are required.
Presenting results
• A big difference to the usefulness of a model can be made by effective presentation of results.
Good presentation leads not just to easier communication of the results, but also improves the
perception of the quality of the underlying model.
• the model file name and/or the model name and version number;
• the date and time of printing;
• the model user’s name;
19
Financial Modelling in Excel (v2007) © Celsoft Corporation
Spreadsheet models are powerful tools for analysis. A successfully developed model can analyse
a variety of alternative situations and inform the decision making process. Using a model to
produce useful information requires skill, not just to generate computer printouts.
Data tables
One of the most powerful ways that a model can be used to improve understanding of a problem
is by illustrating the sensitivity of the results to varying some of the key input assumptions. It is
very easy to understand how your input assumptions affect the results by using Data tables.
Simulation
When we use the word sim ulation , we refer to any analytical method meant to imitate a real-
life system, especially when other analyses are too mathematically complex or too difficult to
reproduce.
Without the aid of simulation, a spreadsheet model will only reveal a single outcome, generally
the most likely or average scenario. Spreadsheet risk analysis uses both a spreadsheet model and
simulation to automatically analyze the effect of varying inputs on outputs of the modeled
system.
One of the problems with carrying out sensitivity analysis is combining the individual sensitivities
in the model, of which there may be many, in a way that realistically reflects the range of
possible outcomes that may occur in practice. A simple approach that is often used is to set all
the sensitivities to the worst case, and look at the results that this gives. However, by doing this
the downside of the project is vastly over-stated; in reality, it is unlikely that everything will go
wrong together.
Monte Carlo simulation is often used in business for risk and decision analysis, to help make
decisions given uncertainties in market trends, fluctuations, and other uncertain factors.
20
Financial Modelling in Excel (v2007) © Celsoft Corporation
Even if realistic combinations of sensitivities are used, simply applying these in the model do not
provide any information about how likely, or probable, the resultant outcome is.
The technique of Monte Carlo analysis overcomes these problems: it allows the user to combine
many sensitivities in many different ways, effectively running hundreds, or even thousands, of
scenarios. The output shows the range of possible results, and how probable each is. This
information enables the user to understand the effect that variations in the inputs have on the
output: in other words, this method makes clear the risks involved in the project.
This problem would require advanced risk analysis software like Risk Solver or Risk Analyser to
solve.
Graphs
Graphs allow faster assimilation of information than a page of numbers. Graphs are frequently
valuable as a way to introduce information, but usually need to be supported by the actual
numbers. Bear in mind that different people in your audience may have different needs, those
who just want to understand the basic trends may want to see the graphs while those who need
to understand more detail are likely to want to see the numbers behind it.
A common mistake is to use an inappropriate type of graph for the message you want to present.
As spreadsheet modelling activities and underlying organizations grow and become more
complex, the need for universal spreadsheet modelling standards and accountability behind
decision-making processes also grows. Traditionally, a lack of generally accepted principles
governing the model development process has resulted in model developers constructing models
according to individual tastes and preferences. This lack of standardization has often resulted in
unnecessary frustration and confusion as model developers have difficulty understanding and
utilizing models developed by others and model users have been forced to adapt to models on a
case by case basis.
In the absence of universal spreadsheet modelling standards the spreadsheet modelling sector
would continue to become more complex, disjointed and difficult for management and decision
21
Financial Modelling in Excel (v2007) © Celsoft Corporation
makers to control, unnecessarily creating significant costs and risks for business organizations.
Standards currently govern many areas of the business world. Some of the more prominent
examples include accounting standards and auditing standards. In general, there is considerable
standardization of reporting and analysis in relation to historical results, but very little
standardization in relation to forecasted results. Prior to the first release of these Best Practice
Spreadsheet Modelling Standards, there was little or no standardization within the spreadsheet
modelling sector. Despite this lack of standardization, spreadsheet models have still been used as
a fundamental component of the quantitative analysis which is undertaken in relation to almost
every major business decision.
The Best Practice Spreadsheet Modelling Standards and Conventions empower both model
developers and model users with the knowledge to improve the quality and efficiency of
spreadsheet modelling activities. In this regard, the primary spreadsheet modelling benefits of
adopting these Standards and Conventions are:
22
Financial Modelling in Excel (v2007) © Celsoft Corporation
Objectives
Introduce Microsoft Excel 2007 citing the major changes from earlier versions.
Understanding the Excel environment.
Understand some of the basic efficiency functionalities in Microsoft Excel.
Excel, as you probably know, is the world’s most widely-used spreadsheet program, and is part of the
Microsoft Office suite. Other spreadsheet programs are available, but Excel is by far the most popular and
has become the world standard. Here are just a few of the uses for Excel:
Number crunching: Create budgets, analyze survey results, and perform just about any type of
financial analysis you can think of.
Creating charts: Create a wide variety of highly customizable charts.
Organizing lists: Use the row-and-column layout to store lists efficiently.
Accessing other data: Import data from a wide variety of sources.
Creating graphics and diagrams: Use Shapes and the new SmartArt to create professional-
looking diagrams.
Automating complex tasks: Perform a tedious task with a single mouse click with Excel’s
macro and Visual Basic Application (VBA) capabilities.
Name Description
Quick Access Toolbar A toolbar that you customize to hold commonly-used commands
Ribbon The main location to find Excel’s commands. Clicking an item in the Tab
list changes the ribbon that’s displayed.
23
Financial Modelling in Excel (v2007) © Celsoft Corporation
In previous versions of Excel, end users were free to customize their menus and toolbars. Things
have changed in Excel 2007. Now, the only end user customization option is the Quick Access
Toolbar (QAT). Normally, the QAT appears on the left side of the title bar. Alternatively, you can
display the QAT below the ribbon. Right-click the QAT and select Show Quick Access Toolbar
below Ribbon.
By default, the QAT contains three tools: Save, Undo, and Repeat. You can, of course, customize
the QAT by adding other commands that you use often. To add a command from the Ribbon to
your QAT, right-click the command and choose Add to Quick Access Toolbar. If you click the
downward-pointing arrow to the right of the QAT, you see a drop-down menu with some
additional commands that you might want to place in your QAT.
Excel has commands that aren’t available in the Ribbon. In most cases, the only way to access
these commands is to add them to your QAT.
It is accessed by right-clicking on any menu tab, and selecting “Customize Quick Access
Toolbar…”
24
Financial Modelling in Excel (v2007) © Celsoft Corporation
The tools shown below will be useful during the course insert these tools onto your Quick Access Toolbar
if not already there:
25
Financial Modelling in Excel (v2007) © Celsoft Corporation
Excel 2003
1. Select Tools/Customize
2. Select the “Commands” tab
3. Drag the tools from the right-hand box onto your toolbar at the top of the screen
26
Financial Modelling in Excel (v2007) © Celsoft Corporation
Application
Fast and efficient use of Excel tools.
27
Financial Modelling in Excel (v2007) © Celsoft Corporation
Hyperlinks
Application
Jump from one sheet to another efficiently.
Link to a reference file or website efficiently.
• Hyperlinks can be inserted into a spreadsheet linking a cell with a cell in another sheet or
another file.
• Give the cell you wish to link to (in the file you wish to link to) a range name, e.g.
Income Statement
• Select the cell you wish to link from (cell C3 in our example)
• Select the commands “Insert/Link/Hyperlink”. (2003 – Insert/Hyperlink) The
dialogue box below appears.
• Click on “Place in This Document” (see the left hand side of the dialogue box), and select
the desired “Defined name” (the cell’s range name)
• Click “OK”
28
Financial Modelling in Excel (v2007) © Celsoft Corporation
Benefits
Efficient referencing of a cell
Readable formulas that simply model auditing and testing.
Using other Excel techniques including referencing in VBA.
You can assign any worksheet cell or range a name and then use that name in a formula.
Reasons:
• Ease of reference
• Required by certain functions.
• Makes model auditing easy.
29
Financial Modelling in Excel (v2007) © Celsoft Corporation
An easy way to assign a name is to select a cell or range and enter the name you want to
assign it in Excel’s “name box” on the formula bar.
A name cannot have two words and the same name cannot be used twice in the same workbook.
If you name cells or ranges after you’ve already used their values in formulas, you need
to explicitly tell Excel to use the names in the formulas. You can do this with the command
Formulas, Define Name, Apply Names or Insert, Name, Apply in 2003. Select the names you
want to use from the Apply Names
The section above (Naming Cells & Ranges Used in Formulas) describes the usual methods used
to create names in a worksheet. However, you can also make use of a special range-naming
option: Name a range by using a formula.
When might you want to do this? A common situation is this: You want to refer to a range whose
length may change over time. You don’t want to have to rename the range each time its length
changes. However, if you name the range using a dynamic formula, the formula will adjust when
the range length adjusts, and the name will always refer to the entire set of data.
Here’s how to accomplish this:
• Locate your list in some area of the worksheet. Below is a simple, three column list.
• Without having selected the list, issue the commands Formulas, Define Name to
open the “Define Name” dialog. Supply a name for the range when prompted.
30
Financial Modelling in Excel (v2007) © Celsoft Corporation
31
Financial Modelling in Excel (v2007) © Celsoft Corporation
Notes:
A dynamic range name constructed in this way will appear in the list of worksheet range names
when you choose Formulas, Define Name. However it will not appear in the list of names in the
drop-down Name Box on the formula bar.
Because a dynamic named range is dependent on calculation, it can only be referenced in an
open workbook.
Application
To ensure accuracy of formulas when formulas are copied across and down the
sheets
You may often want to use the same formula in one or more places in a worksheet. It’s most
efficient to build the formula one time and then copy it to the other locations where you need it.
If you copy a formula, you must understand Excel’s relative and absolute addressing. For copied
formulas Excel uses relative addressing as the default. That is, Excel adjusts the cell references in
your source formula when the formula is copied to a new location.
Specify absolute addressing with a dollar sign (an arbitrarily selected symbol) before the row
reference and the column reference.
Relative: The row and column references can change when you copy the formula to
another cell because the references are actually offsets from the current row and
column.
Absolute: The row and column references do not change when you copy the formula
because the reference is to an actual cell address.
Mixed: Either the row or column reference is relative, and the other is absolute.
11
You can enter non-relative references (that is, absolute or mixed) manually by inserting dollar
signs in the appropriate positions of the cell address. Or you can use a handy shortcut: the F4
32
Financial Modelling in Excel (v2007) © Celsoft Corporation
key. When you’ve entered a cell reference (by typing it or by pointing), you can press F4
repeatedly to have Excel cycle through all four reference types.
Worksheet Protection
Objectives
To understand how to protect formula cells and leave input cells editable
To understand how to assign permissions to users.
To understand workbook protection and its effects.
• Excel users protect a worksheet for a variety of reasons. One reason is to prevent yourself or
others from accidentally deleting formulas or other critical data.
• A common scenario is to protect a worksheet so that the data can be changed, but the formulas
can’t be changed.
• To protect a worksheet, activate the worksheet and choose Review ➪ Changes ➪ Protect Sheet.
Excel displays the Protect Sheet dialog box
• Note that providing a password is optional. If you enter a password, that password will be
required to unprotect the worksheet. If you accept the default options in the Protect Sheet dialog
box, none of the cells on the worksheet can be modified.
FIGURE 31.1
Unlocking cells
• In many cases, you will want to allow some cells to be changed when the worksheet is protected.
For example, your worksheet may have some input cells that are used by formula cells. In such a
case, you would want the user to be able to change the input cells, but not the formula cells.
Every cell has a Locked attribute, and that attribute determines whether the cell can be changed
when the sheet is protected.
• By default, all cells are locked. To change the locked attribute, select the cell or range and then
use the
• Protection tab of the Format Cells dialog box To display this dialog box, right-click the cell or
range and choose Format Cells from the shortcut menu (or press Ctrl+1). Remove the check
mark from Locked and click OK.
33
Financial Modelling in Excel (v2007) © Celsoft Corporation
31
To unprotect a protected sheet, choose Review ➪ Changes ➪ Unprotect Sheet. If the sheet is
protected with a password, you’re prompted to enter the password.
34
Financial Modelling in Excel (v2007) © Celsoft Corporation
• Edit scenarios: If checked, the user can use scenarios (see Chapter 36).
35
Financial Modelling in Excel (v2007) © Celsoft Corporation
Objectives
To understand some key techniques of summarizing data
To understand techniques of preventing invalid data from being entered in cells
To understand ways of accessing (filtering) data and consolidating different data sets.
Application
Prevent invalid typing into particular cells, accidentally or intentionally.
To prevent entering of invalid input that will lead the model to producing ridiculous
results e.g. margin of 120% or decimals of human beings.
Circle in valid data if the data had already been entered into the spreadsheet
Present the user with a drop-down list containing a list of input choices
Validation can be performed on data in a cell according to the validation criteria shown in the box
below.
36
Financial Modelling in Excel (v2007) © Celsoft Corporation
One can also select the message that should be displayed if invalid data is entered, along with
the “error alert” symbol that should be displayed.
Any Value: Selecting this option removes any existing data validation.
Whole Number: The user must enter a whole number. You specify a valid range of whole
numbers by using the Data drop-down list. For example, you can specify that the entry must be a
whole number greater than or equal to 100.
Decimal: The user must enter a number. You specify a valid range of numbers by using the
Data drop-down list. For example, you can specify that the entry must be greater than or equal
to 0 and less than or equal to 1.
List: The user must choose from a list of entries you provide.
Date: The user must enter a date. You specify a valid date range by using the Data drop-down
list. For example, you can specify that the entered data must be greater than or equal to January
1, 2007, and less than or equal to December 31, 2007.
Time: The user must enter a time. You specify a valid time range by using the Data drop-down
list. For example, you can specify that the entered data must be greater than 12:00 p.m.
Text Length: The length of the data (number of characters) is limited. You specify a valid
length by using the Data drop-down list. For example, you can specify that the length of the
entered data be 1 (a single alphanumeric character).
37
Financial Modelling in Excel (v2007) © Celsoft Corporation
Custom: To use this option, you must supply a logical formula that determines the validity of the
user’s entry (a logical formula returns either True or False). You can enter the formula directly
into the Formula control (which appears when you select the Custom option), or you can specify
a cell reference that contains a formula.
To present the user with a drop-down box containing a list of input choices for the
current cell:
1. In a column on the spreadsheet list the choices for the input cells concerned
2. Select the cells on the spreadsheet for which this list of choices is applicable
3. Open the Data validation dialogue box. In the “Allow” box, select “List”
4. In the “Source” box now presented, enter the column of choices, either in the form of cell
addresses or a range name (if you named the column of choices). Note that the range or name
should be preceded by an =. This creates what is termed an in-cell drop down list.
The Data ➪ Data Tools ➪ Data Validation drop-down control contains an item named Circle
Invalid Data. When you click this item, circles appear around cells that contain incorrect entries.
If you correct an invalid entry, the circle disappears.
To get rid of the circles, choose Data ➪ Data Tools ➪ Data Validation ➪ Clear Validation Circles.
For simple data validation, the data validation feature is quite straightforward and easy to use.
But the real power of this feature becomes apparent when you use data validation formulas.
The formula that you specify must be a logical formula that returns either True or False.
If the formula evaluates to True, the data is considered valid and remains in the cell. If the
formula evaluates to False, a message box appears that displays the message specified in the
Error Alert tab of the Data Validation dialog box.
You can specify a formula in the Data Validation dialog box by selecting the Custom option in the
Allow drop-down list of the Settings tab. You can enter the formula directly into the Formula
control, or you can enter a reference to a cell that contains a formula.
If the formula that you enter into the Data Validation dialog box contains a cell reference, that
reference is considered a relative reference, based on the upper-left cell in the selected range.
38
Financial Modelling in Excel (v2007) © Celsoft Corporation
This formula assumes that A2 is the active cell in the selected range. Note that you can’t use this
formula for a cell in row 1.
39
Financial Modelling in Excel (v2007) © Celsoft Corporation
Application
Understand how to filter data and drill down to select the data one wants to see.
Understand how to filter data using various dimensions either on the same place or
extracting the selection required.
To merely display required data (filter the database), choose the commands Data/Sort
& filter/Filter. This will cause arrow buttons to be displayed at the top of each column.
Click the arrow button in the column in which you want to search for data, and choose from the
selection list displayed.
To remove the AutoFilter arrows, again select the commands Data/Sort & Filter/Filter. (2003
– Data/Filter/Autofilter)
Advanced Filtering
The Advanced command works differently from the Filter command in several important ways.
It displays the Advanced Filter dialog box instead of the AutoFilter menu.
You type the advanced criteria in a separate criteria range on the worksheet and above the range
of cells or table you want to filter. Microsoft Office Excel uses the separate criteria range in the
Advanced Filter dialog box as the source for the advanced criteria.
40
Financial Modelling in Excel (v2007) © Celsoft Corporation
To switch between viewing the results and viewing the formulas that return the results, press CTRL+`
(grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A B C
Because the equal sign (=) is used to indicate a formula when you type text or a value in a cell,
Excel evaluates what you type; however, this may cause unexpected filter results. To indicate an
equality comparison operator for either text or a value, type the criteria as a string expression in
the appropriate cell in the criteria range:
=''=entry''
Where entry is the text or value you want to find. For example:
What you type in the cell What Excel evaluates and displays
="=Davolio" =Davolio
="=3000" =3000
41
Financial Modelling in Excel (v2007) © Celsoft Corporation
To find rows that meet multiple criteria for one column, type the criteria directly below each other in
separate rows of the criteria range. In the example, you would enter:
A B C
2 ="=Davolio"
3 ="=Buchanan"
Click a cell in the list range. In the example, you would click any cell in the range, A6:C10.
On the Data tab, in the Sort & Filter group, click Advanced.
To filter the list range by hiding rows that don't match your criteria, click Filter the list, in-place.
To filter the list range by copying rows that match your criteria to another area of the worksheet,
click Copy to another location, click in the Copy to box, and then click the upper-left corner of the
area where you want to paste the rows.
Tip When you copy filtered rows to another location, you can specify which columns to include in
the copy operation. Before filtering, copy the column labels for the columns that you want to the
first row of the area where you plan to paste the filtered rows. When you filter, enter a reference
to the copied column labels in the Copy to box. The copied rows will then include only the
columns for which you copied the labels.
42
Financial Modelling in Excel (v2007) © Celsoft Corporation
A B C
2 ="=Produce" >1000
In the Criteria range box, enter the reference for the criteria range, including the criteria labels. In the
example, you would enter $A$1:$C$2.
A B C
2 ="=Produce"
3 ="=Buchanan"
A B C D
2 >6000 <6500
3 <500
43
Financial Modelling in Excel (v2007) © Celsoft Corporation
A B C
2 ="=Davolio" >3000
3 ="=Buchanan" >1500
Application
Quickly summarize data by categories.
Drill down data to see the summary or the detail.
Like the other list management features in Excel, the Subtotal recognizes data in an Excel list
format and will operate on that list if you click on any cell in the list before getting started.
When you plan to use the Subtotal command, always first consider whether and how to use the
Sort command. Excel can’t effectively subtotal unsorted data.
Choose the commands Data, Outline Group, Subtotal to open the Subtotal dialog box.
The default subtotal function is sum. Other functions available include Count, Average, Max, Min,
Product, Count Nums, StdDev, StdDevp, Var, and Varp.
The dialog allows you to determine how the subtotal will be organized. Excel creates subtotals
and puts them in an outline format so they can be easily collapsed for a summary view.
Remove subtotals with Data, Outline Group, Subtotals, Remove All.
44
Financial Modelling in Excel (v2007) © Celsoft Corporation
Outline
Excel provides a convenient outline feature that facilitates showing your data in summary or
detail fashion. The Outline view displays automatically after you use the Subtotal command. Or,
you can create an outline automatically (Data, Group and Outline, Auto Outline) or by hand.
To create an outline manually, select the data to outline and choose Data, Group and Outline,
Group.
Make sure you insert your own summary rows with formulas immediately below or above each group of
detail rows.
An outline can encompass up to eight levels of detail.
Remove outlining from the spreadsheet with Data, Group and Outline, Clear Outline.
Application
Understand how to filter data and drill down to select the data one wants to see.
Understand how to filter data using various dimensions either on the same place or
extracting the selection required.
To summarize and report results from separate worksheets, you can consolidate data from each
separate worksheet into a master worksheet. The worksheets can be in the same workbook as
the master worksheet or in other workbooks. When you consolidate data, you are assembling
data so that you can more easily update and aggregate it on a regular or ad hoc basis.
For example, if you have a worksheet of expense figures for each of your regional offices, you
might use a consolidation to roll up these figures into a corporate expense worksheet. This
master worksheet might contain sales totals and averages, current inventory levels, and highest
selling products for the entire enterprise.
For data consolidation, use Excel’s Consolidate dialog box. This method is very flexible, and in
some cases, it even works if the source worksheets aren’t laid out identically.
This technique can create consolidations that are static (no link formulas) or dynamic (with link
formulas).
The Data Consolidate feature supports the following methods of consolidation:
45
Financial Modelling in Excel (v2007) © Celsoft Corporation
• By position: This method is accurate only if the worksheets are laid out
identically.
• By category: Excel uses row and column labels to match data in the source
worksheets. Use this option if the data is laid out differently in the source
worksheets or if some source worksheets are missing rows or columns.
The picture below shows the Consolidate dialog box, which appears when you choose Data ➪
Data Tools ➪Consolidate. Following is a description of the controls in this dialog box:
FIGURE 27.6
Function list box: Specify the type of consolidation. Sum is the most commonly used
consolidation function, but you also can select from ten other options.
Reference text box: Specify a range from a source file that you want to consolidate. You can
enter the range reference manually or use any standard pointing technique (if the workbook is
open). After you enter the range in this box, click the Add button to add it to the All References
list. If you consolidate by position, don’t include labels in the range. If you consolidate by
category, do include labels in the range.
All References list box: Contains the list of references that you have added with the Add
button.
46
Financial Modelling in Excel (v2007) © Celsoft Corporation
Use Labels In check boxes: Use to instruct Excel to perform the consolidation by examining
the labels in the top row, the left column, or both positions. Use these options when you
consolidate by category.
Create Links to Source Data check box: When you select this option, Excel adds summary
formulas for each label and creates an outline. If you don’t select this option, the consolidation
doesn’t use formulas, and an outline isn’t created.
Browse button: Displays a dialog box that enables you to select a workbook to open. It inserts
the filename in the Reference box, but you have to supply the range reference. You’ll find that
your job is much easier if all the workbooks to be consolidated are open.
Add button: Adds the reference in the Reference box to the All References list. Make sure that
you click this button after you specify each range.
Delete button: Deletes the selected reference from the All References list.
To consolidate data, use the Consolidate command in the Data Tools group on the Data tab.
Use a PivotTable report instead of a consolidation Use a PivotTable report to consolidate data
Consolidate by position
Make sure that each range of data is in list format: each column has a label in the first row
and contains similar facts, and there are no blank rows or columns within the list.
47
Financial Modelling in Excel (v2007) © Celsoft Corporation
Put each range on a separate worksheet. Don't put any of the ranges on the worksheet
where you plan to put the consolidation.
Name each range: Select the entire range, and then on the Formulas tab in the Named
Cells group, click the arrow next to Name a Range, and type a name for the range in the
Name box.
2. Click the upper-left cell of the area where you want the consolidated data to appear in the
master worksheet.
NOTE Make sure that you leave enough cells to the right and below this cell for the
consolidated data. The Consolidate command populates the area as needed.
4. In the Function box, click the summary function that you want Microsoft Office Excel to use to
consolidate the data.
5. If the worksheet is in another workbook, click Browse to locate the file, and then click OK to
close the Browse dialog box.
The file path is entered in the Reference box followed by an exclamation point.
6. Type the name that you gave the range, and then click Add. Repeat this step for each range.
7. Decide how you want to update the consolidation. Do one of the following:
To set up the consolidation so that it updates automatically when the source data changes,
select the Create links to source data check box.
IMPORTANT You can only select this check box if the worksheet is in another workbook.
Once you select this check box, you won't be able to change which cells and ranges are
included in the consolidation.
48
Financial Modelling in Excel (v2007) © Celsoft Corporation
To set up the consolidation so that you can update the consolidation manually by changing
the included cells and ranges, clear the Create links to source data check box.
8. Leave the boxes under Use labels in blank. Excel does not copy the row or column labels in the
source ranges to the consolidation. If you want labels for the consolidated data, copy them from
one of the source ranges or enter them manually.
Consolidate by category
Select the check boxes under Use labels in that indicate where the labels are located in the
source ranges: either the Top row, the Left column, or both.
NOTES
Any labels that don't match up with labels in the other source areas result in separate rows
or columns in the consolidation.
Make sure that any categories that you don't want to consolidate have unique labels that
appear in only one source range.
An example
The simple example in this section demonstrates the power of Excel’s Data Consolidate feature.
shows three single-sheet workbooks that will be consolidated.
These worksheets report product sales for three months. Notice, however, that they don’t all
report on the same products. In addition, the products aren’t even listed in the same order. In
other words, these worksheets aren’t laid out identically. Creating consolidation formulas
manually would be a very tedious task.
Use workbooks The files are named region1.xlsx, region2.xlsx, and region3.xlsx.
To consolidate this information, start with a new workbook. You don’t need to open the source
workbooks, but consolidation is easier if they are open. Follow these steps to consolidate the
workbooks:
Choose Data ➪ Data Tools ➪ Consolidate. Excel displays its Consolidate dialog box.
Use the Function drop-down list to select the type of consolidation summary that you
want to use. Use Sum for this example.
49
Financial Modelling in Excel (v2007) © Celsoft Corporation
Enter the reference for the first worksheet to consolidate. If the workbook is open, you
can point to the reference. If it’s not open, click the Browse button to locate the file on disk. The
reference must include a range. You can use a range that includes complete columns, such as
A:K. This range is larger than the actual range to consolidate, but using this range ensures that
the consolidation will still work if new rows and columns are added to the source file. When the
reference in the Reference box is correct, click Add to add it to the All References list.
Enter the reference for the second worksheet. You can point to the range in the Region2
workbook, or you can simply edit the existing reference by changing Region1 to Region2 and
then clicking Add. This reference is added to the All References list.
Enter the reference for the third worksheet. Again, you can edit the existing reference by
changing Region2 to Region3 and then clicking Add. This final reference is added to the All
References list.
Because the worksheets aren’t laid out the same, select the Left column and Top row
check boxes to force Excel to match the data by using the labels.
Select the Create Links to Source Data check box to make Excel create an outline
with external references.
Click OK to begin the consolidation.
Refreshing a consolidation
If you want to refresh a consolidation later, you don’t have to re-enter the references.
Just display the Consolidate dialog box, verify that the ranges are correct, and click OK.
Formula Auditing
Application
Understand how to trace errors, check cell dependents and precedents.
Understand how to display formulas on screen instead of their cell results
50
Financial Modelling in Excel (v2007) © Celsoft Corporation
You can locate the cells that supply data for formulas and find cells that depend on values in other cells
by using the Auditing Group on the Formulas Tab
Application
Understand how to dynamically format cells to reveal information hidden in numbers.
Understand how to improve the appearance of your model through fine visual effects.
Conditional formatting works a little differently in Excel 2007, and quite a few enhancements
have been made.
The Conditional formatting command sequence is: Home/Styles/Conditional formatting
This will bring up the following dialogue box
51
Financial Modelling in Excel (v2007) © Celsoft Corporation
• And selecting the first item on the menu will expand the dialogue box to:
• And again selecting the first item “Greater than…” will bring up the dialogue box allowing you to
format the cell according to its contents.
• To format a cell according to a formula, one would select the “More rules…”. option on the
previous page. The following dialogue box will appear
52
Financial Modelling in Excel (v2007) © Celsoft Corporation
53
Financial Modelling in Excel (v2007) © Celsoft Corporation
EXCEL FUNCTIONS
Objectives
Understand various Excel functions and learn how to apply them in different
modeling scenarios.
Formula Basics
54
Financial Modelling in Excel (v2007) © Celsoft Corporation
^ Exponentiation
& Concatenation
= Logical comparison (equal to)
> Logical comparison (greater than)
< Logical comparison (less than)
>= Logical comparison (greater than or equal to)
<= Logical comparison (less than or equal to)
<> Logical comparison (not equal to)
You can, of course, use as many operators as you need to perform the desired calculation.
Following are some examples of formulas that use various operators.
When Excel calculates the value of a formula, it uses certain rules to determine the order in
which the various parts of the formula are calculated.
You need to understand these rules if you want your formulas to produce the desired results.
55
Financial Modelling in Excel (v2007) © Celsoft Corporation
The table below lists the Excel operator precedence. This table shows that exponentiation has
the highest precedence (it’s performed first) and logical comparisons have the lowest precedence
(they’re performed last).
You can use parentheses to override the Excel’s built-in order of precedence. Expressions within
parentheses are always evaluated first. E.g.
=(B2-B3)*B4
You can also nest parentheses within formulas—that is, put them inside other parentheses. If you
do so, Excel evaluates the most deeply nested expressions first—and then works its way out.
Here’s an example of a formula that uses nested parentheses:
=((B2*C2)+(B3*C3)+(B4*C4))*B6
Every left parenthesis, of course, must have a matching right parenthesis. If you have many
levels of nested parentheses, keeping them straight can sometimes be difficult. If the
parentheses don’t match, Excel displays a message explaining the problem—and won’t let you
enter the formula.
In some cases, if your formula contains mismatched parentheses, Excel may propose a correction
to your formula.
56
Financial Modelling in Excel (v2007) © Celsoft Corporation
Most formulas you create use worksheet functions. These functions enable you to greatly
enhance the power of your formulas and perform calculations that are difficult (or even
impossible) if you use only the operators discussed previously. For example, you can use the TAN
function to calculate the tangent of an angle. You can’t do this calculation by using only the
mathematical operators.
=(A1+A2+A3+A4+A5+A6+A7+A8+A9+A10)/10
Not very pretty, is it? Even worse, you would need to edit this formula if you added another cell
to the range. Fortunately, you can replace this formula with a much simpler one that uses one of
Excel’s built-in worksheet functions:
=AVERAGE(A1:A10)
57
Financial Modelling in Excel (v2007) © Celsoft Corporation
• One argument
• A fixed number of arguments
• An indeterminate number of arguments
• Optional arguments
An example of a function that doesn’t use an argument is the NOW function, which returns the
current date and time. Even if a function doesn’t use an argument, you must still provide a set of
empty parentheses, like this:
=NOW()
All told, Excel includes 340 functions. And if that’s not enough, you can purchase additional
specialized functions from third-party suppliers—and even create your own custom functions (by
using VBA) if you’re so inclined. Some users feel a bit overwhelmed by the sheer number of
functions, but you’ll probably find that you use only a dozen or so, on a regular basis. And as
you’ll see, Excel’s Insert Function dialog box (described later in this section) makes it easy to
locate and insert a function, even if it’s not one that you use frequently.
You can insert a function by selecting it from one of the function categories.
58
Financial Modelling in Excel (v2007) © Celsoft Corporation
Yet another way to insert a function while you’re entering a formula is to use the Function List to
the left of the Formula bar
59
Financial Modelling in Excel (v2007) © Celsoft Corporation
You can sometimes use a circular reference to your advantage. For example, suppose a company
has a policy of contributing 5 percent of its net profit to charity. The contribution itself, however,
is considered an expense—and is therefore subtracted from the net profit figure. This produces a
circular reference (see the accompanying figure).
The Contributions cell contains the following formula:
=5%*Net_Profit
=Gross_Income-Expenses-Contributions
These formulas produce a resolvable circular reference. If the Enable Iterative Calculation setting
is on, Excel keeps calculating until the Contributions value is, indeed, 5 percent of Net Profit. In
other words, the result becomes increasingly accurate until it converges on the final solution.
You’ve probably noticed that Excel calculates the formulas in your worksheet immediately. If you
change any cells that the formula uses, Excel displays the formula’s new result with no effort on
your part. All this happens when Excel’s Calculation mode is set to Automatic. In Automatic
Calculation mode (which is the default mode),
Sometimes, however, you may want to control when Excel calculates formulas. For example, if
you create a worksheet with thousands of complex formulas, you’ll find that processing can slow
to a snail’s pace while
Excel does its thing. In such a case, set Excel’s calculation mode to Manual—which you can do by
choosing Formulas ➪ Calculation ➪ Calculation Options ➪ Manual
60
Financial Modelling in Excel (v2007) © Celsoft Corporation
Logical Functions
The IF function
It is often necessary in financial modelling to use logical tests in a model. i.e. a statement that
reads:
If this condition is true, then use this formula, else use that formula.
E.g. If sales are greater than target of 10 000, then calculate commission at 10% of the sales,
else just pay the minimum commission of 1000.
In most modelling systems this is known as an If, Then, Else statement.
Excel’s IF function is probably the most important of the set of Excel’s logical functions. Excel’s
other logical functions are AND, NOT, OR, FALSE and TRUE.
The IF function checks a condition that must be either true or false. If the condition is true, the
function returns one value; if the condition is false, the function returns another value.
The IF function has three arguments: the condition you want to check, the value to return if the
condition is true, and the value to return if the condition is false.
The syntax of the IF statement is:
=IF(logical_test,value_if_true,value_if_false)
Here are some examples of logical statements in a spreadsheet system:
=If(C6>=10000,C6*10%,1000)
=If(B10<0,"Overdraft","Cash")
=If(B1<>B2,"Out of balance!","")
Nested Ifs
Ifs can also be nested. For example you might have an IF statement that reads “IF(this
condition is true, THEN take D1*D10, ELSE IF this condition is true, THEN take D1*D11,
ELSE IF this condition is true, THEN take D1*D12, ELSE take 0)
For example:
61
Financial Modelling in Excel (v2007) © Celsoft Corporation
The OR Function
Like the AND function, the OR function can handle up to thirty conditions. However, the OR
function requires that only one of the arguments evaluate as true in order to return true. So
=OR(1<5,12<2) evaluates to True.
Excel has additional functions you can use to analyze your data based on a condition. For
example, to count the number of occurrences of a string of text or a number within a range of
cells, use the COUNTIF worksheet function. To calculate a sum based on a string of text or a
number within a range, use the SUMIF worksheet function.
Worksheet Controls
Application
To manipulate the model more easily and flexibly
To prevent manual typing of assumptions or model variations
To control invalid input into the model
62
Financial Modelling in Excel (v2007) © Celsoft Corporation
Introduction
You can build a custom form for a worksheet by using Excel controls. Buttons, check boxes,
drop-down lists, spinners, and other kinds of controls can make a worksheet easier for you and
others to use.
There are two categories of Excel controls you can choose from, and there’s a close
correspondence between the two. Controls on the Forms toolbar are something of a holdover
from earlier versions of Excel. These controls don’t require any special programming or definition
other than what can be provided from within Excel itself.
Use a control from the Forms toolbar when you need a control to run a single macro or for a
simple interactive worksheet. In contrast, controls from the Control Toolbox are more
sophisticated. They’re closely linked to Excel’s Visual Basic for Applications (VBA) environment
and require that you write code to manage how the control works.
To bring the Forms toolbox to the Excel ribbon, go to Excel Options, under Customize, All
commands, select “Controls”, click Add and then OK.
Once you add the control toolbox, it will now be accessible on the Quick access toolbar
63
Financial Modelling in Excel (v2007) © Celsoft Corporation
All the control buttons on the Forms toolbar work using the same two-part process:
1) Draw the control on the worksheet, and
2) Format the control.
3) Link a control to a cell
Formatting a control determines what data is associated with the control. In addition, formatting
can change a control’s protection status, how it moves when underlying cells are moved, and
what its data entry limits might be.
Formatting a control is achieved by right clicking the control and then selecting “format control”
and then the “Control” tab.
=if(LinkCell,TrueResult,FalseResult)
64
Financial Modelling in Excel (v2007) © Celsoft Corporation
Option Button
Used most often to make a single choice from a group of options. E.g., selecting a depreciation
method to use.
If you draw several option buttons on a worksheet, all these buttons will belong to the same
group, so the user will be able to select only one button at a time.
However, you can enclose a group of buttons in a group box (drawn with the group tool) and
these buttons will function separately from any outside the group box or any other group box.
The CHOOSE function can be used to turn the numeric choice into different results. For example:
=choose(LinkCell,Result1,Result2,Result3...)
65
Financial Modelling in Excel (v2007) © Celsoft Corporation
1. After drawing the control, on the workings worksheet, enter a column with the items you want to
appear in the list. Enter one item per cell.
2. Right click the list and choose Format Control to display the “Format Control” tabbed dialog.
Select the Control tab.
3. Select the Input Range box and drag across the range in the worksheet that contains the list.
This is the list that will appear in the list box or combo box.
4. Select the Cell Link box and click the cell that will receive the results of the list.
5. If you’re formatting a combo box, enter in the Drop down Lines box the number of lines that
should display when the list appears.
=index(ItemList,LinkCell,ColumnNo)
In our example, assume that a list of items in the range B3:B7 is used for the range in the Input
Range box. The link cells for the list is C9 & E9. This cell is where the numeric position of the
item the user selects will appear. In another cell you can show the item selected with the
formulae:
=index($B$3:$B$7,$E$9,1) =index($B$3:$C$7,$G$9,2)
This function looks down the list B3:B7 to the row specified in C9. The item in that row of the list
(1) is then returned to the cell that contains the index function.
Two-list lookup
You can display details in another column by choosing from one list but use a corresponding
value from another list. You could use this technique to look up items by name or description etc
e.g. in our example in the list box we are selecting the day in order to pick the corresponding %
66
Financial Modelling in Excel (v2007) © Celsoft Corporation
To use a two-list lookup, you need two lists. One is used as the Input Range for the control, and
it’s the list the user sees. The other is used to find the result you want to retrieve and have
appeared in the worksheet. Notice the formula on top.
The Spinner
A spinner increases or decreases the amount in the cell linked to it. Holding down the mouse
button on a spinner makes it change continuously. Note that using a spinner can cause a great
deal of recalculation in a worksheet unless you control worksheet recalculation deliberately.
67
Financial Modelling in Excel (v2007) © Celsoft Corporation
The Command Button works with macros hence will be deferred until the topic on Macros.
LookUp Functions
Excel has three functions (LOOKUP, VLOOKUP, and HLOOKUP) designed for this task.
A lookup formula essentially returns a value from a table by looking up another related value. A
common telephone directory provides a good analogy. If you want to find a person’s telephone
number, you first locate the name (look it up) and then retrieve the corresponding number.
D2 =VLOOKUP(C2,EmpData,2,FALSE)
E2 =VLOOKUP(C2,EmpData,3,FALSE)
F2 =VLOOKUP(C2,EmpData,4,FALSE)
G2 =VLOOKUP(C2,EmpData,5,FALSE)
Lookup formulas in row 2 look up the information for the employee name in cell C2.
68
Financial Modelling in Excel (v2007) © Celsoft Corporation
In addition, the MATCH and INDEX functions are often used together to return a cell or relative cell
reference for a lookup value.
NOTE: If the range_lookup argument is TRUE or omitted, the first column of the lookup table
must be in ascending order.
A very common use for a lookup formula involves an income tax rate schedule. The tax rate schedule
shows the income tax rates for various income levels. The following formula (in cell B3) returns the tax
rate for the income in cell B2:
=VLOOKUP(B2,D2:F7,3)
Note that an exact match is not required. If an exact match is not found in the first column of the lookup
table, the VLOOKUP function uses the next largest value that is less than the lookup value. In other
words, the function uses the row in which the value you want to look up is greater than or equal to the
69
Financial Modelling in Excel (v2007) © Celsoft Corporation
row value but less than the value in the next row. In the case of a tax table, this is exactly what you
want to happen.
look up_value : The value to be looked up in the first row of the lookup table.
table_array : The range that contains the lookup table.
row _index _num : The row number within the table from which the matching value is returned.
range_lookup : Optional. If TRUE or omitted, an approximate match is returned. (If an exact
match is not found, the next largest value less than lookup_value is returned.) If FALSE,
VLOOKUP will search for an exact match. If VLOOKUP can’t find an exact match, the function
returns #N/A.
=HLOOKUP(B2,E1:J3,3)
LOOKUP(lookup_value,lookup_vector,result_vector)
70
Financial Modelling in Excel (v2007) © Celsoft Corporation
result_vector : The single-column or single-row range that contains the values to be returned. It
must be the same size as the lookup_vector.
The LOOKUP function looks in a one-row or one-column range (lookup_vector) for a value (lookup_value)
and returns a value from the same position in a second one-row or one-column range (result_vector).
Generally, a counting formula returns the number of cells in a specified range that meet certain
criteria. A summing formula returns the sum of the values of the cells in a range that meet
certain criteria.
71
Financial Modelling in Excel (v2007) © Celsoft Corporation
=ROWS(Data)*COLUMNS(Data)
=COUNTBLANK(Data)
The COUNTBLANK function also counts cells containing a formula that returns an empty string.
For example, the formula that follows returns an empty string if the value in cell A1 is greater
than 5. If the cell meets this condition, the COUNTBLANK function counts that cell.
=IF(A1>5,””,A1)
You can use the COUNTBLANK function with an argument that consists of entire rows or
columns. For example, this next formula returns the number of blank cells in column A:
=COUNTBLANK(A:A)
The following formula returns the number of empty cells on the entire worksheet named Sheet1.
You must enter this formula on a sheet other than Sheet1, or it will create a circular reference.
=COUNTBLANK(Sheet1!1:1048576)
=COUNTA(Data)
The COUNTA function counts cells that contain values, text, or logical values (TRUE or FALSE).
72
Financial Modelling in Excel (v2007) © Celsoft Corporation
NOTE: If a cell contains a formula that returns an empty string, that cell is included in
the count returned by COUNTA, even though the cell appears to be blank.
Cells that contain a date or a time are considered to be numeric cells. Cells that contain a logical
value (TRUE or FALSE) aren’t considered to be numeric cells.
• range : The range that contains the values that determine whether to include a particular
cell in the count
• criteria : The logical criteria that determine whether to include a particular cell in the
count
73
Financial Modelling in Excel (v2007) © Celsoft Corporation
cell A1
=COUNTIF(Data,”*”) Returns the number of cells containing text
=COUNTIF(Data,”???”) Returns the number of text cells containing exactly
three characters
=COUNTIF(Data,”budget”) Returns the number of cells containing the single
word budget (not case sensitive)
=COUNTIF(Data,”*budget*”) Returns the number of cells containing the text
budget anywhere within the text
=COUNTIF(Data,”A*”) Returns the number of cells containing text that
begins with the letter A (not case sensitive):
=COUNTIF(Data,TODAY()) Returns the number of cells containing the current
date
=COUNTIF(Data,”>”&AVERAGE(Data)) Returns the number of cells with a value greater
than the average
=COUNTIF(Data,3)+COUNTIF(Data,-3) Returns the number of cells containing the value 3 or
–3
=COUNTIF(Data,TRUE) Returns the number of cells containing logical TRUE
=COUNTIF(Data,”#N/A”) Returns the number of cells containing the #N/A
error value
=COUNTIFS(Amount,”>100”,Amount,”<=200”)
The first member of the pair is the range to be counted (in this case, the range named Amount);
the second member of the pair is the criterion.
74
Financial Modelling in Excel (v2007) © Celsoft Corporation
The MODE function returns the most frequently occurring value in a range.
To count the number of times the most frequently occurring value appears in the range (in other
words, the frequency of the mode), use the following formula:
=COUNTIF(Data,MODE(Data))
Summing Formulas
The examples in this section demonstrate how to perform common summing tasks by using
formulas. The formulas range from very simple to relatively complex array formulas that compute
sums by using multiple criteria.
=SUM(Data)
The SUM function can take up to 255 arguments. The following formula, for example, returns the
sum of the values in five noncontiguous ranges:
=SUM(A1:A9,C1:C9,E1:E9,G1:G9,I1:I9)
You can use complete rows or columns as an argument for the SUM function. The formula that
follows, for example, returns the sum of all values in column A.
75
Financial Modelling in Excel (v2007) © Celsoft Corporation
=SUM(A:A)
Computing a cumulative sum
You may want to display a cumulative sum of values in a range—sometimes known as a “running total.”
=SUM(B$2:B2)
The SUMIF function is very useful for single-criterion sum formulas. The SUMIF function takes
three arguments:
• Range : The range containing the values that determine whether to include a particular
cell in the sum.
• Criteria : An expression that determines whether to include a particular cell in the sum.
• sum _range : Optional. The range that contains the cells you want to sum. If you omit
this argument, the function uses the range specified in the first argument.
=SUMIF(Difference,”<0”)
Because you omit the third argument, the second argument (“<0”) applies to the values in the
Difference range.
You don’t need to hard-code the arguments for the SUMIF function into your formula. For
example, you can create a formula, such as the following, which gets the criteria argument from
the contents of cell G2:
=SUMIF(Difference,G2)
This formula returns a new result if you change the criteria in cell G2.
76
Financial Modelling in Excel (v2007) © Celsoft Corporation
=SUMIF(Difference,”<0”,Amount)
This formula uses the values in the Difference range to determine if the corresponding values in the
Amount range contribute to the sum.
=SUMIF(Office,”=Oregon”,Amount)
=SUMIFS(Amount,Difference,”<0”,Office,”Oregon”)
Text Functions
Text Functions
Excel has an excellent assortment of worksheet functions that can handle text. You can access these
functions just where you’d expect: from the Text control in the Function Library group of the Formula
tab.
77
Financial Modelling in Excel (v2007) © Celsoft Corporation
The ISTEXT function takes a single argument and returns TRUE if the argument contains text and FALSE
if it doesn’t contain text. The formula that follows returns TRUE if A1 contains a string:
=ISTEXT(A1)
=A1&A2
NOTE: Excel also has a CONCATENATE function, which takes up to 255 arguments. For
example:
=CONCATENATE(A1,B1,C1,D1)
These functions are quite straightforward. The formula that follows, for example, converts the text in cell
A1 to proper case.
=PROPER(A1)
Date-Related Functions
Excel has quite a few functions that work with dates. These functions are accessible by choosing
Formulas ➪ Function Library ➪ Date & Time.
78
Financial Modelling in Excel (v2007) © Celsoft Corporation
=TODAY()
You can also display the date combined with text. The formula that follows, for example, displays text,
such as
It’s important to understand that the TODAY function is updated whenever the worksheet is calculated.
For example, if you enter either of the preceding formulas into a worksheet, the formulas display the
current date. But when you open the workbook tomorrow, they will display the current date (not the date
when you entered the formula).
=EndDay-StartDay+1
79
Financial Modelling in Excel (v2007) © Celsoft Corporation
When calculating the difference between two dates, you may want to exclude weekends and holidays.
For example, you may need to know how many business days fall in the month of November. This
calculation should exclude Saturdays, Sundays, and holidays. The NETWORKDAYS function can help out.
NEW FEATURE: In versions prior to Excel 2007, the NETWORKDAYS function was available
only when the Analysis ToolPak add-in was installed. The function is now part of Excel 2007.
The NETWORKDAYS function calculates the difference between two dates, excluding weekend days
(Saturdays and Sundays). As an option, you can specify a range of cells that contain the dates of
holidays, which are also excluded. Excel has absolutely no way of determining which days are holidays,
so you must provide this information in a range.
Figure 13.4 shows a worksheet that calculates the work days between two dates. The range A2:A11
contains a list of holiday dates. The two formulas in column C calculate the work days between the dates
in column A and column B. For example, the formula in cell C15 is
=NETWORKDAYS(A15,B15,A2:A11)
This formula returns 4, which means that the seven-day period beginning with January 1 contains four
work days. In other words, the calculation excludes one holiday, one Saturday, and one Sunday. The
formula in cell C16 calculates the total number of work days in the year.
=YEAR(A1)-YEAR(B1)
This formula uses the YEAR function to extract the year from each date and then subtracts one year from
the other. If cell B1 contains a more recent date than the date in cell A1, the result will be negative.
13
Displaying the current time
This formula displays the current time as a time serial number (or as a serial number without an
associated date):
80
Financial Modelling in Excel (v2007) © Celsoft Corporation
=NOW()-TODAY()
You need to format the cell with a time format to view the result as a recognizable time. The quickest
way is to choose Home ➪ Number ➪ Format Number and select Time from the drop-down list.
ANALYSING DATA
Pivot Tables
A pivot table is essentially a dynamic summary report generated from a database. The database
can reside in a worksheet (in the form of a table) or in an external data file or into a meaningful
presentation of the data. For example, a pivot table can create frequency distributions and cross-
tabulations of several different data dimensions. In addition, you can display subtotals and any
level of detail that you want. Perhaps the most innovative aspect of a pivot table is its
interactivity. After you create a pivot table, you can rearrange the information in almost any way
imaginable and even insert special formulas that perform new calculations.
You even can create post hoc groupings of summary items (for example, combine Northern
Region totals with Western Region totals). And the icing on the cake: With a few mouse clicks,
you can apply formatting to a pivot table to convert it into an attractive report.
One minor drawback to using a pivot table is that, unlike a formula-based summary report, a
pivot table does not update automatically when you change information in the source data. This
drawback doesn’t pose a serious problem, however, because a single click of the Refresh button
forces a pivot table to update itself with the latest data.
81
Financial Modelling in Excel (v2007) © Celsoft Corporation
FIG
This table consists of a month’s worth of new account information for a three-branch bank. The table
contains 712 rows, and each row represents a new account. The table has the following columns:
• What is the daily total new deposit amount for each branch?
• How many accounts were opened at each branch, broken down by account type?
• What’s the dollar distribution of the different account types?
• What types of accounts do tellers open most often?
• How does the Central branch compare to the other two branches?
• In which branch do tellers open the most checking accounts for new customers?
You can, of course, spend time sorting the data and creating formulas to answer these questions.
Often, however, a pivot table is a much better choice. Creating a pivot table takes only a few
seconds, doesn’t require a single formula, and produces a nice-looking report. In addition, pivot
tables are much less prone to error than creating formulas.
82
Financial Modelling in Excel (v2007) © Celsoft Corporation
The picture below shows a pivot table created from the bank data. This pivot table shows the
amount of new deposits, broken down by branch and account type. This particular summary
represents one of dozens of summaries that you can produce from this data.
FIGURE 34.2
A simple pivot table.
The picture below shows another pivot table generated from the bank data. This pivot table uses
a drop-down Report Filter for the Customer item (in row 1). In the figure, the pivot table displays
the data only for Existing customers. (The user can also select New or All from the drop-down
control.) Notice the change in the orientation of the table? For this pivot table, branches appear
as column labels, and account types appear as row labels. This change, which took about five
seconds to make, is another example of the flexibility of a pivot table.
83
Financial Modelling in Excel (v2007) © Celsoft Corporation
E 34.3
A pivot table that uses a report filter.
84
Financial Modelling in Excel (v2007) © Celsoft Corporation
Excel attempts to guess the range, based on the location of the active cell. If you’re creating a
pivot table from an external data source, you need to select that option and then click Choose
Connection to specify the data source. 34.5
In the Create PivotTable dialog box, you tell Excel where the data is and where you want the
pivot table.
Use the bottom section of the Create PivotTable dialog box to indicate the location for your pivot
table. The default location is on a new worksheet, but you can specify any range on any
worksheet, including the worksheet that contains the data.
Click OK, and Excel creates an empty pivot table and displays its PivotTable Field List, as shown
below
85
Financial Modelling in Excel (v2007) © Celsoft Corporation
86
Financial Modelling in Excel (v2007) © Celsoft Corporation
• Data tables: Create a table that displays the results of selected formula cells as
you systematically change one or two input cells.
• Scenario Manager: Create named scenarios and generate reports that use
outlines or pivot tables.
This method doesn’t require too much explanation. In fact, the example that opens this chapter
demonstrates how it’s done. Manual what-if analysis is based on the idea that you have one or
more input cells that affect one or more key formula cells. You change the value in the input cells
and see what happens to the formula cells. You may want to print the results or save each
scenario to a new workbook.
The term scenario refers to a specific set of values in one or more input cells.
Manual what-if analysis is very common, and people often use this technique without even
realizing that they’re doing a type of what-if analysis. This method of performing what-if analysis
certainly has nothing wrong with it, but you should be aware of some other techniques.
Data Tables
This section discusses one of Excel’s most underutilized features: data tables. A data table is a
dynamic range that summarizes formula cells for varying input cells. You can create a data table
fairly easily, but data tables have some limitations. In particular, a data table can deal with only
one or two input cells at a time. This limitation becomes clear as you view the examples.
FIGURE 36.2
87
Financial Modelling in Excel (v2007) © Celsoft Corporation
The screen above shows the setup for the data table area. Row 3 consists of references to the
formulas in the worksheet. For example, cell F3 contains the formula =C10, and cell G3 contains
the formula =C11.
Column E contains the values of the single input cell (interest rate) that Excel will use in the
table.
To create the table, select the data table range (in this case, E3:I12) and then choose Data ➪
Data Tools ➪
What-If Analysis ➪ Data Table. Excel displays the Data Table dialog box, shown below.
88
Financial Modelling in Excel (v2007) © Celsoft Corporation
FIGURE 36.4
In the Data Table dialog box, you must specify the worksheet cell that contains the input value.
Because variables for the input cell appear in the left column in the data table, you place this cell
reference in the text box labeled Column Input Cell. Enter C7 or point to the cell in the
worksheet. Leave the Row Input Cell field blank. Click OK, and Excel fills in the table with the
calculated results (see below).
89
Financial Modelling in Excel (v2007) © Celsoft Corporation
Although it looks similar to a one-input table, the two-input table has one critical difference: It
can show the results of only one formula at a time. With a one-input table, you can place any
number of formulas, or references to formulas, across the top row of the table. In a two-input
table, this top row holds the values for the second input cell. The upper-left cell of the table
contains a reference to the single result formula.
FIGURE 36.6URE 36.7
To create the data table:
1. Enter the response rate values in F4:M4.
2. Enter the number mailed values in E5:E14.
3. Select the range E4:M14 and choose Data ➪ Data Tools ➪ What-If Analysis ➪ Data
Table.
4. In the Data Table dialog box, specify B5 as the Row input cell (the response rate)
and cell
B4 as the Column input (the number mailed).
5. Click OK, and Excel fills in the data table.
90
Financial Modelling in Excel (v2007) © Celsoft Corporation
• A two-input table shows the results of only one formula cell (although you can create
additional tables for more formulas).
• In many situations, you’re interested in a few select combinations, not an entire table
that shows all possible combinations of two input cells.
Excel’s Scenario Manager Feature makes automating your what-if models easy. You can store
different sets of input values (called changing cells in the terminology of Scenario Manager) for
any number of variables and give a name to each set. You can then select a set of values by
name, and Excel displays the worksheet by using those values. You can also generate a summary
report that shows the effect of various combinations of values on any number of result cells.
These summary reports can be an outline or a pivot table.
For example, your annual sales forecast may depend on several factors. Consequently, you can
define three scenarios: best case, worst case, and most likely case. You then can switch to any of
these scenarios by selecting the named scenario from a list. Excel substitutes the appropriate
input values in your worksheet and recalculates the formulas.
Defining scenarios
To introduce you to Scenario Manager, this section starts with an example that uses a simplified
production model, as shown below.
91
Financial Modelling in Excel (v2007) © Celsoft Corporation
Formulas calculate the total profit per product (row 13) and the total combined profit (cell B15).
Management is trying to predict the total profit, but is uncertain what the hourly labor cost and
material costs will be. They’ve identified three scenarios, listed in Table 36.1.
TABLE 36.1
Scenario Hourly Cost Materials Cost
Best Case 30 57
Worst Case 38 62
Most Likely 34 59
The Best Case scenario has the lowest hourly cost and lowest materials cost. The Worst Case
scenario has high values for both the hourly cost and the materials cost. The third scenario, Most
Likely Case, has intermediate values for both of these input cells. The managers need to be
prepared for the worst case, however, and they’re interested in what would happen under the
Best Case scenario.
Choose Data ➪ Data Tools ➪ What-If Analysis ➪ Scenario Manger to display the Scenario
Manager Dialog box. When you first open this dialog box, it tells you that no scenarios are
defined—which is not too surprising because you’re just starting. As you add named scenarios,
they appear in the Scenarios list in this dialog box.
To add a scenario, click the Add button in the Scenario Manager Dialog box. Excel displays its
Add Scenario dialog box, shown below.
92
Financial Modelling in Excel (v2007) © Celsoft Corporation
• Changing Cells: The input cells for the scenario. You can enter the cell addresses directly or
point to them. If you’ve created a name for the cells, type the name. Non-adjacent cells are
allowed (if pointing to multiple cells, press Ctrl while you click the cells). Each named
scenario can use the same set of changing cells or different changing cells. The number of
changing cells for a scenario is limited to 32.
• Comment: By default, Excel displays the name of the person who created the scenario and
the date that it was created. You can change this text, add new text to it, or delete it.
• Protection: The two Protection options (preventing changes and hiding a scenario) are in
effect only when you protect the worksheet and choose the Scenario option in the Protect
Sheet dialog box. Protecting a scenario prevents anyone from modifying it; a hidden scenario
doesn’t appear in the Scenario Manager Dialog box.
Displaying scenarios
After you define all the scenarios and return to the Scenario Manager Dialog box, the dialog box
displays the names of your defined scenarios. Select one of the scenarios and then click the
Show button. Excel inserts the corresponding values into the changing cells and calculates the
worksheet to show the results for that scenario.
Modifying scenarios
The Edit button in the Scenario Manager Dialog box lets you change one or more of the values
for the changing cells of a scenario. From the Scenarios list, select the scenario that you want to
change and click the Edit button. In the Edit Scenario dialog box, click OK to access the Scenario
Values dialog box. Make your changes and click OK to return to the Scenario Manager Dialog
box. Notice that Excel automatically updates the Comments box with new text that indicates
when the scenario was modified.
Merging scenarios
In workgroup situations, you may have several people working on a spreadsheet model, and
several people may have defined various scenarios. The marketing department, for example, may
have its opinion of what the input cells should be, the finance department may have another
opinion, and your CEO may have yet another opinion.
Excel makes it easy to merge these various scenarios into a single workbook by using the Merge
button in the Scenario Manager Dialog box. Clicking this button displays the Merge Scenarios
dialog box.
93
Financial Modelling in Excel (v2007) © Celsoft Corporation
Before you merge scenarios, make sure that the workbook from which you’re merging is open.
Then, click the Merge button in the Scenario Manager Dialog box. Excel displays its Merge
Scenarios dialog box.
Choose the workbook that contains the scenarios you’re merging in the Book drop-down list.
Then, choose the sheet that contains the scenarios you want to merge from the Sheet list box.
(Notice that the dialog box displays the number of scenarios in each sheet as you scroll through
the Sheet list box.) Click OK, and you return to the previous dialog box, which now displays the
scenario names that you merged from the other workbook.
1. Right-click your QAT and choose Customize Quick Access Toolbar. Excel
displays the Customization tab of the Excel Options dialog box.
2. In the Choose Commands From drop-down list, select Commands not In the
Ribbon.
3. Scroll down the list and select Scenario.
4. Click the Add button.
5. Click OK to close the Excel Options dialog box.
Using the Scenarios control is more efficient than bringing up the Scenario Manager Dialog box to
view a different scenario.
94
Financial Modelling in Excel (v2007) © Celsoft Corporation
The Scenario Summary dialog box also asks you to specify the result cells (the cells that contain
the formulas in which you’re interested). For this example, select B13:D13 and B15 (a multiple
selection) to make the report show the profit for each product, plus the total profit.
Goal Seeking
Goal Seeking: Determines the value that you need to enter in a single input cell to produce a
result that you want in a dependent (formula) cell.
Solver: Determines the values that you need to enter in multiple input cells to produce a result
that you want. Moreover, because you can specify certain constraints to the problem, you gain
significant problem-solving ability.
Single-cell goal seeking is a rather simple concept. Excel determines what value in an input cell
produces a desired result in a formula cell. The following example shows you how single-cell goal
seeking works.
A goal-seeking example
The diagram above shows the mortgage loan worksheet used in the preceding chapter. This
worksheet has four input cells (C4:C7) and four formula cells (C10:C13). Originally, this
worksheet was used for a what-if analysis example. This example demonstrates the opposite
95
Financial Modelling in Excel (v2007) © Celsoft Corporation
approach. Rather than supply different input cell values to look at the calculated formulas, this
example lets Excel determine one of the input values that will produce the desired result.
FIGURE 37.1
This worksheet is a good demonstration of goal seeking.
Assume that you’re in the market for a new home and you know that you can afford a $1,800
monthly mortgage payment. You also know that a lender can issue a 30-year fixed-rate mortgage
loan for 6.50 percent, based on an 80-percent loan-to-value (that is, a 20-percent down
payment). The question is “What is the maximum purchase price I can handle?” In other words,
what value in cell C4 causes the formula in cell C11 to result in $1,800? In this simple example,
you could plug values into cell C4 until C11 displays $1,800. With more complex models, Excel
can usually determine the answer much more efficiently.
To answer the question posed in the preceding paragraph, first set up the input cells to match
what you already know. Specifically:
Enter 20% in cell C5 (the down payment percent)
Enter 360 in cell C6 (the loan term, in months)
Enter 6.5% in cell C7, the annual interest rate
Next, choose Data ➪ Data Tools ➪ What-If Analysis ➪ Goal Seek. Excel displays the Goal Seek
dialog box, shown below. Completing this dialog box is similar to forming a sentence.
You want to set cell C11 to 1800 by changing cell C4. Enter this information in the dialog box
either by typing the cell references or by pointing with the mouse. Click OK to begin the goal-
seeking process.
FIGURE 3
96
Financial Modelling in Excel (v2007) © Celsoft Corporation
In less than a second, Excel displays the Goal Seek Status box, which shows the target value and
the value that Excel calculated. In this case, Excel found an exact value. The worksheet now
displays the found value in cell C4 ($284,779). As a result of this value, the monthly payment
amount is $1,800. At this point, you have two options:
Introducing Solver
The Excel Goal-Seek feature is a useful tool, but it clearly has limitations. It can solve for only
one adjustable cell, and it returns only a single solution. Excel’s powerful Solver tool extends this
concept by enabling you to do the following:
• Specify multiple adjustable cells
• Specify constraints on the values that the adjustable cells can have
• Generate a solution that maximizes or minimizes a particular worksheet cell
• Generate multiple solutions to a problem
Although goal seeking is a relatively simple operation, using Solver can be much more
complicated. In fact, Solver is probably one of the most difficult (and potentially frustrating)
features in Excel. I’m the first to admit that Solver isn’t for everyone. In fact, most Excel users
have no use for this feature.
However, many users find that having this much power is worth spending the extra time to learn
about it.
• A target cell depends on other cells and formulas. Typically, you want to maximize or
minimize this target cell or set it equal to some value.
• The target cell depends on a group of cells (called changing cells) that Solver can
adjust to affect the target cell.
• The solution must adhere to certain limitations, or constraints.
97
Financial Modelling in Excel (v2007) © Celsoft Corporation
After you set up your worksheet appropriately, you can use Solver to adjust the changing cells
and produce the result that you want in your target cell—and simultaneously meet all the
constraints that you’ve defined.
You access Solver by choosing Data ➪ Analysis ➪ Solver. If this command isn’t available, you
need to install the Solver add-in. It’s a simple process:
Use Solver to determine the number of units to maximize the total profit.
You don’t need an MBA degree to realize that the greatest profit comes from Product C.
Therefore, in order to maximize total profit, the logical solution is to produce only Product C. If
things were really this simple, you wouldn’t need tools such as Solver. As in most situations, this
company has some constraints that must be met:
98
Financial Modelling in Excel (v2007) © Celsoft Corporation
These four constraints make the problem more realistic and a bit more challenging. In fact, it’s a
perfect problem for Solver.
I go into more detail in a moment, but here is the basic procedure for using Solver:
1. Set up the worksheet with values and formulas. Make sure that you format cells
logically; for example, if you can’t produce partial units of your products, format those
cells to contain numbers with no decimal values.
2. Choose Data ➪ Analysis ➪ Solver to bring up the Solver dialog box.
3. Specify the target cell.
4. Specify the range that contains the changing cells.
5. Specify the constraints.
6. Change the Solver options, if necessary.
7. Let Solver solve the problem.
To start Solver to tackle this example, choose Data ➪ Analysis ➪ Solver. Excel displays its Solver
Parameters dialog box, shown below.
In this example, the target cell is D6—the cell that calculates the total profit for three products.
99
Financial Modelling in Excel (v2007) © Celsoft Corporation
1. Enter (or point to) cell D6 in the Set Target Cell field of the Solver Parameters
dialog box.
2. Because the objective is to maximize this cell, click the Max option.
3. Next, specify the changing cells (which are in the range B3:B5) in the By
Changing Cells box. The next step is to specify the constraints on the problem. The
constraints are added one at a time and appear in the box labeled Subject To the
Constraints.
4. To add a constraint, click the Add button. Excel displays the Add Constraint dialog
box, shown below.
This dialog box has three parts: a Cell Reference, an operator, and a Constraint value.
5. To set the first constraint (that the total production capacity is 300 units), enter B6
as the
Cell Reference, choose equal (=) from the drop-down list of operators, and enter 300
as the Constraint value.
6. Click Add to add the remaining constraints. The diagram below summarizes the
constraints for this problem.
FIGURE 37ABLE 37.1
Constraints Summary
Constraint Expressed As
Capacity is 300 units B6=300
At least 50 units of Product A B3>=50
At least 40 units of Product B B4>=40
No more than 40 units of Product C B5<=40
7. After you enter the last constraint, click OK to return to the Solver Parameters
dialog box, which now lists the four constraints. At this point, Solver knows everything
about the problem.
100
Financial Modelling in Excel (v2007) © Celsoft Corporation
8. Click the Solve button to start the solution process. You can watch the progress
onscreen, and Excel soon announces that it has found a solution. The Solver Results dialog box is
shown below
• Replace the original changing cell values with the values that Solver found.
• Restore the original changing cell values.
• Create any or all three reports that describe what Solver did.
• Click the Save Scenario button to save the solution as a scenario, so that
Scenario Manager can use it.
If you specify any report options, Excel creates each report on a new worksheet, with an
appropriate name.
The figure below shows an Answer Report. In the Constraints section of the report, two of the
constraints are binding, which means that these constraints were satisfied at their limit with no
more room to change.
101
Financial Modelling in Excel (v2007) © Celsoft Corporation
ANALYSIS TOOLPAK
The Analysis ToolPak is an add-in that provides analytical capability that normally isn’t available.
In previous versions of Excel, the Analysis ToolPak add-in included many additional worksheet
functions. In Excel 2007, these worksheet functions are built into Excel and no longer require the
Analysis ToolPak add-in.
These analysis tools offer many features that may be useful to those in the scientific,
engineering, and educational communities—not to mention business users whose needs extend
beyond the normal spreadsheet fare.
The Analysis ToolPak covers each of the following tools:
102
Financial Modelling in Excel (v2007) © Celsoft Corporation
• Histogram
RECORDING A MACRO
A macro is a recorded (or typed) sequence of commands that can be used repeatedly.
Any macro given the name Auto_Open will run the moment the workbook containing the
macro is opened
Macros can greatly speed up your work and increase accuracy by having long sequences of
commands rerun at the press of a button.
Macros can be written in Excel 4 macro language or in Visual Basic, and are stored:
In the case of macros written in Excel 4 language, on a Macro sheet. A macro sheet can be set
up by right-clicking the mouse whilst pointing at a sheet tab.
In the case of macros written in Visual Basic, macros are placed on a Visual Basic sheet, but this
sheet does not appear as a sheet in the workbook. To see this sheet hit Alt F11.
Before recording macros it will be convenient to get the Developer tab displayed on
the ribbon.
Do this by:
1. Click on the Office tool
2. Select “Excel Options” shown at the bottom of the dialogue box
3. Select “Popular”
4. Click the checkbox for “Show Developer tab in the Ribbon”
103
Financial Modelling in Excel (v2007) © Celsoft Corporation
The easiest way to create a macro is to record it whilst you are actually performing the desired
task.
Recording a Macro:
To record a macro all you have to do is turn on the macro recorder and then perform the
commands as usual.
While you are doing this Excel writes the commands step by step onto a visual basic module
sheet (not visible as a sheet in your workbook)
2. Replace the name Macro1 with a name of your choice, and type a single letter to use as a shortcut key
in the “Shortcut Key” box. Pressing Ctrl and this shortcut letter will cause the macro to run once
complete. Avoid shortcut letters that are already used by Excel (such as ctrl c for Copy)
3. Decide where you would like to store this macro. (Normally in this workbook, but if stored in a
Personal Macro Workbook, it will be available for all spreadsheet files)
104
Financial Modelling in Excel (v2007) © Celsoft Corporation
4. Click OK. A Stop button appears, and the word Recording appears at the bottom of the screen.
7. To view your macro hit Alt F8 (or Developer/Code/Macros), and click the Edit button.
105