This action might not be possible to undo. Are you sure you want to continue?

# Financial Modelling in Excel

January 1

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

Introducing Financial Modelling……………………………………… 3 Financial Modelling Life Cycle………………………………………… 8 Introducing Excel 2007…………………………………………………..23 Keyboard Shortcuts……………………………………………………….27 Hyperlinks……………………………………………………………………28 Naming Cells & Ranges…………………………………………….…… 29 Relative, Mixed & Absolute Referencing…………………………… 32 Worksheet Protection………………………………………………….…34 Data Validation……………………………………………………….…….36 Auto Filtering & Advanced Filtering…………………………………..40 Subtotal, Outline, Grouping & Ungrouping………………………….44 Consolidation……………………………………………………………….45 Formula Auditing…………………………………………………………..50 Conditional Formatting…………………………………………………..51 Introducing Excel functions…………………………………………….54 Logical functions…………………………………………………………..61 Worksheet Controls……………………………………………………….62 Lookup functions…………………………………………………………..68 Statistical functions……………………………………………………….71 Text functions………………………………………………………………77 Date & Time functions……………………………………………………78 Pivot Tables…………………………………………………………………81 Data Tables…………………………………………………………………87 Scenario Manager…………………………………………………………90 Goal seek…………………………………………………………………….95 Solver…………………………………………………………………………97 Analysis Toolpak………………………………………………………….102 Recording macros………………………………………………………..103

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

they develop templates and tables. balance sheet and to allow Treasurers to do what-if analysis and sensitivity analysis to guide Treasury strategy.g. • • • • • • Forecast interest rates. Forecast market liquidity.Financial Modelling in Excel (v2007) • ratio analysis and many more. liquidity. No formal Training . Spreadsheets. Forecast balance of payments and exchange rates. Dealing strategy for the company etc.Excel is a powerful tool. The models/ templates developed are not robust. Powerful tool . No formal approach to model development. users start at the build stage. 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. 4 . © Celsoft Corporation This will be followed by predictive insights of economic measures and expectations of the department e. Expected GDP. No professionalism & Standardization .g. Quantrix etc. In this training session. few users receive formal training in modelling techniques and the use of Excel.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. our focus shall be on spreadsheet modelling. Forecast inflation rates. CURRENT ‘MODELLING’ IN AFRICA Users do not develop models. These factors will be integrated in a robust financial model to forecast the expected treasury income.However. which can help automate a number of processes as well as guiding decision-making. they are very simple and ill-defined. Usually numbers are hardcoded in cells with no relationship with each other. Modelling can be done by employing various types of software e.

But there is a big difference between the best and worst examples of spreadsheet modelling. What can you do? The answer is by taking steps to understand and control the process of spreadsheet development.Financial Modelling in Excel (v2007) © Celsoft Corporation The templates are not reliable as you can see circular references. for major transactions with large sums of money at stake.com for more. test the results and use your model effectively you can achieve much more with your spreadsheet. No deliberate action by organizations to set up models or modelling units/departments. multi-dimensional modeling software like the leading Quantrix Modeler developed by Quantrix in America. define the objectives and calculations. No deliberate plan to train staff in financial modelling. Visit www. 5 . 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. design the spreadsheet so that it is easy to understand. SPREADSHEET MODELLING SPREADSHEET MODELLING is a generic term that is used to describe any form of analysis which is undertaken using spreadsheets. Not useable by another person who has not developed them. Nowadays spreadsheets are being replaced by better. most modellers have no formal training in good modelling techniques and that their organizations do not have even the most rudimentary internal standards. errors and some formulas that you can’t follow and some parts having been deleted. It has been established through research that. Inputs and formulas are combined and not protected to prevent accidental deletions.quantrix. Spreadsheet modelling is also commonly referred to as ‘financial modelling’ or simply ‘modelling’. Very important decisions are made without the use of a computer model. Example: No Modelling Skills Power of Modelling 2.

spreadsheet application functionality has improved at an exponential rate. Applying each of the six stages helps to ensure the development of a robust model. With the rise of spreadsheet application technology. model developers have had to significantly improve their spreadsheet modelling skills. we will focus on the simple classification of models into the following types: Complex Models For complex modelling problems. Functional spreadsheet applications were first developed in the 1980s with the release of Lotus 1-2-3. reducing the risk of errors and getting the most from the modelling process. 3. As such. 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. The demand for spreadsheet modelling continues to rise. 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. In order to meet the increasingly complex demands of model users. 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. Since the release of Microsoft Excel 95®. providing spreadsheet model developers with the tools to construct increasingly sophisticated spreadsheet models. spreadsheet model development has become a highly skilled area of expertise within the business community. with decision makers relying more intensively on spreadsheet modelling analysis as the basis for their decisions. TYPES OF MODELS There are different types of models but in this manual. both simple and complex spreadsheet models have become more prevalent throughout the business world. 6 . Spreadsheets are now generally accepted as being the primary vehicle for modelling in business.Financial Modelling in Excel (v2007) The Evolution of Spreadsheet Modelling © Celsoft Corporation Spreadsheet modelling is a relatively new area of expertise within the business world.

e. Examples of simple models are ones that take only a day of two to complete. and allows for specific data input with results defined by formulas. changes to input data). and backward changes are known as “Goal seeks” Optimization This is linear programming. or models that are used only by the developer for his or her own thought process.g. A model is defined with sets of constraints (e. 7 . Other Types of Financial Models Deterministic This is the most common type of model. Generally. “Forward” changes are commonly known as “what-ifs” (i. changes can be made backwards and forwards. A change to the input data will result in a change to the calculated results. “only 40 hours are available”) and then manipulates the input data in line with the constraints to either maximize or minimize a result.Financial Modelling in Excel (v2007) Simple Models © Celsoft Corporation The principles of good spreadsheet design apply equally to the simplest or most complex of models.

but the accessibility and ease of use of spreadsheet packages sometimes make it easy for these stages to become blurred.Financial Modelling in Excel (v2007) © Celsoft Corporation THE MODELLING LIFE CYCLE All computer models go through different stages of development. 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. and 8 . The scope stage is the time to make sure that you understand. 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. • • Understand in outline how the model will work. at least in broad terms. Each of the six stages of model development is described in detail below: SCOPE This stage is where we assess the nature. Experience of the way that models grow and evolve will help you develop better models. • Consider the level of detail required in the input and logical assumptions (complexity). scale and complexity of the model required..

The process of model specification should run the other way around. calculations and inputs. • To specify is to define the logic of the model in sufficient detail to provide an unambiguous statement of how the results will be calculated. specification is time consuming and this stage may need to be revisited a number of times. • In short. It allows you to tackle the most difficult problems associated with the model before you have started to build it.Financial Modelling in Excel (v2007) © Celsoft Corporation • SPECIFY Agree the above with the key stakeholders. the results should drive the calculations and the calculations should drive the required inputs. For modelling projects where the logic of the model is difficult to define. all spreadsheet models should flow from inputs through calculations to the model results. Calculations can be defined by drawing a simple bubble diagram as shown below: 9 . the specify stage involves defining the model results. because it is model results that are most important and should determine the structure of the model. The model objectives should drive the results required. • Try to avoid letting the availability of input data determine the output that you produce. Logically. • • • We recommend that you separate the process of specifying the model calculations from actually building the model.

Balance sheet – opening balance Year end Numeric £000's Date Firm figure. the formula: 10 . Hints and tips for model specification Are constants constant? Avoid using hard coded numbers in the definition of a formula. Firm figure. Capex model (auto transfer). Status Policy variable. Finance dept. 2dp Units % Frequency One entry only. One entry only. Marketing dept. Forecast Validation Must be > 0. Capital expenditure Asset life Numeric Numeric ZMK000's Years Finance dept. Marketing dept. One entry per month. Notes The rate applied on any overdraft balances. Price Debtor period Numeric Numeric ZMK Days Agreed estimate. Source Finance dept. Estimated from budget data. For example. Must be > 0. Finance dept. Forecast Policy variable.Financial Modelling in Excel (v2007) © Celsoft Corporation • Specification model inputs can be done as shown in the table below: Data input Interest rate Format %. must be < model period. Must be > 10. Sales Numeric 000's units Must be > 0. One entry per month. Calculated on a straight line basis. Start year only. Finance dept. Start year only. One entry per month. One entry only. Must be > 0.

Financial Modelling in Excel (v2007) © Celsoft Corporation Sale price including VAT = Sale price excluding VAT × 1. it is a good idea to place the calculation of an RPI index in a clear place where it can be referred to quickly. 11 . For the same reason real prices are often used for summary results. the constant can be changed throughout the model instantly. or money of the day. until the VAT rate changes. Real or nominal prices? In financial models. To make conversion between real and nominal prices easy. It works fine. Frequently they are a sign of an error in the logic. it is useful to create a range name. or you want to run sensitivity. 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. the new formula is much simpler to read and understand. Nominal prices. do include the effects of inflation. say “VAT rate”. By following some key guidelines it is possible to make your spreadsheet models significantly easier to use and less prone to errors.175 assumes that the VAT rate is 17. Even if the constant never changes. Real prices are prices of a particular base year and do not increase with inflation. To avoid having to search through every formula in the model for calculations which assume the VAT rate. a common problem is deciding whether to base monetary calculations on real or nominal prices. For a single cell of this sort. Real prices are frequently used for projections because it is possible to separate market trends from increases caused purely by inflation.5%. set up an input cell for the VAT rate and refer to that instead. DESIGN • The design stage involves producing the most effective structure for the model. The best way to avoid a circular reference in your specification is to construct your calculation rules so that they always read from top to bottom and left to right: so that formulae always refer to cells above or to the left. particularly to calculate year on year changes in revenues or costs. Avoid circular references Circular references should be avoided in model calculations.

while keeping them separate from the calculation. Inputs should be separated physically on the sheet. This keeps inputs fairly close to the calculations in which they will be used. the user always knows where to go to look for it. For example where multi-dimensions are required. It reduces the risk that parts of the input data are overlooked or that calculations are overtyped with input figures. Designing a spreadsheet with one formula per row leads to a number of practical benefits. formulae should be written so that a single formula can be copied across the entire row of calculations. • When using multiple sheets. whenever an input assumption needs to be changed. but can also be separated by clear labeling and colouring of the spreadsheet. or down the entire column. • Discipline in the spreadsheet design is even more important to create easy to understand spreadsheet models. • Separating inputs helps to avoid confusion in using and maintaining models. it can be a good idea to maintain a single sheet containing all of the model inputs in one place. such as: 12 . will not be able to do the job. The Six Golden Rules of Spreadsheet model design Rule 1: Separate inputs. So.Financial Modelling in Excel (v2007) • © Celsoft Corporation Before you design a spreadsheet. spreadsheets which are two dimensional. make sure that a spreadsheet is the most appropriate tool for the job. Rule 2: Use one formula per row or column As far as possible. • An alternative design is to place inputs at the top of each sheet which requires them. It is also a good idea to place those results which are produced by the model in a separate place from intermediate calculations. calculations and results • Inputs to a model should be placed on a separate part of the worksheet from calculations.

robust updating and maintenance. by grouping a number of sheets in the model you can update all of the blocks of the model together. it is still a good idea to use comparable worksheets for each subsidiary.Financial Modelling in Excel (v2007) • • • • © Celsoft Corporation quicker development. to an input or calculation on an earlier sheet in the model. by creating one standard sheet which you can then copy a number of times. top to bottom and left to right. the best way to present it in a spreadsheet is to use one worksheet for each repeatable block. Rule 4: Use multiple worksheets… When a model contains sections which can usefully be repeated. For some problems. and to a calculation further down the sheet but in an earlier column. then copied across. When some subsidiaries require more detail. easier updating. Rule 3: Refer to the left and above A well designed spreadsheet can be read like a book: from front to back. each cell reference in a formula could be: • • • to an input or calculation further up the same column. But the benefits of the design far outweigh the extra work required. producing a design with only one formula per row requires some careful thought. This approach will allow for: • • quicker development. • quicker testing. if your model has a different time period in each column. because every formula can be written in a single column. for example referencing the closing balance calculated in the previous time period to use as the opening balance in this time period. effective testing. When the model for a number of subsidiaries in a business are similar. it is easy to develop a worksheet for the most complex example and then 13 . which would be impossible if the blocks were all kept on the same sheet. such as a model of a company with a number of similar business units. This makes the spreadsheet easier to understand and reduces the risk of introducing a circular reference to the calculation. in a specification which has one definition for each row of the final model. by comparing the formulae in each of these sheets and making sure that they are the same. and straightforward documentation. but not quite the same. For example. because every time you change a formula in a cell you know that it should be copied across the rest of the row.

details of the data which is currently in the model. Examples of using colour coding include: • separating inputs from calculations. Rule 6: Include a documentation sheet Any model should contain some internal documentation. the design ideas in this section can all be useful ways to make your model easier to understand and use. an example column layout might be: Columns A. some brief instructions.Financial Modelling in Excel (v2007) © Celsoft Corporation blank out the relevant sections for other subsidiaries. a list of recent changes to the model. by making all of the cells requiring inputs the same colour. Colour coding Colour coding is a useful technique to make spreadsheets easier to use. Units Always using the same column for the same purpose makes the model easier to build and reduces some of the risks of errors. and B. used purely for model control. how to contact the person responsible for the model. Do not delete any rows or columns. who built the model. so that the common elements on the different worksheets can still be edited together. and the model version number and when it was written. it is a good idea to set aside the first sheet of the spreadsheet as a documentation sheet. 14 . other useful items to include on the documentation sheet are: Hints and tips for model design While not being appropriate to all spreadsheets. 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. To make it noticeable. describing the layout of the model or how to use it. Rule 5: Use each column for the same purpose throughout the model However many worksheets you use. Depending on the model. and a summary of key logical assumptions in the model. For a financial model. it is good practice to always use the same layout for columns on all worksheets. The documentation should include: • • • • • • • • a short description of the model’s purpose.

• Units highlighting cells which are linked to external spreadsheets. such as by making the inputs required from the finance department one colour and those required from the marketing department another colour. Many spreadsheet models start their life cycle here with only scant regard to the three stages outlined above. Just as a clearer writing style can be achieved by breaking up long sentences. Hints and tips for model building Keep formulae simple To make your spreadsheet as easy to understand as possible. BUILD The build stage is where the actual coding of the model takes place. e. the column containing the formula can be safely hidden. a clearer model can be achieved by breaking up long formulae.. with little formal documentation. and It is important to use clearly define summarization levels for inputs to a model. keep the formulae simple. Formulae in English For simple models. 15 . but not deleted to keep it as a record of what the model is attempting to do.g. When the model development is complete. ZMK000 or ZMK millions.Financial Modelling in Excel (v2007) • © Celsoft Corporation separating types of inputs. There are two ways of achieving this: Firstly by naming ranges and secondly by providing an extra column that describes the formulae in English. it can be useful to include an extra column containing natural language ‘translations’ of the formulae in the model. This leads to: • • • A model that is more complex than originally expected and takes longer to build. This helps to make the calculations in a model easy to understand. and A lack of common understanding about what the model is doing. Assumptions being made that were not part of the original brief. 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.

For example. or for errors in the model formulae. Use of named cells and ranges Allocating meaningful range names to areas or cells within a spreadsheet can speed up the development process. TEST To test a model is to root out errors and inconsistencies and to increase confidence in the results that the model produces. when equivalent data is provided from more than one source. In most models. especially if it is to be used by a large number of people. Built in features When a model is going to be used over a long period of time. for example when a total revenue is both input and calculated from individual revenue lines. Cross casting is the process of checking that the totals in the rows and columns of a spreadsheet are consistent.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. such that an error message will appear if inputs lie outside a valid range. Error traps can be usefully included: • • • on balancing financial statements. make sure you put them somewhere noticeable. These can be set up to check for errors in the input data provided. the intermediate steps introduced here are worth including for use in other calculations. make the model easier to understand and reduce the risk of errors made by referring to the wrong cell. use the data validation feature. you can: • • use cell protection to protect formulae in the model from being overtyped. Build in error traps It is good practice to include checks for errors in a model. 16 . When you use error traps. such as a balance sheet or a sources and applications of funds statement. For example. try placing references to all of your error traps in a single block at the top of one of the front sheets. while still allowing input values to be changed. Excel provides a number of facilities to make your spreadsheet more robust. and when it is possible to perform a calculation in two equivalent but different ways.

Errors at this stage can undermine the credibility of both the model and its developer. Also involves checking the validity of assumptions. • Macro tests – Checking if all macros and buttons are working effectively. 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. Testing should be carried out by the developer during building and by an independent tester after building but before use. this stage does provide the confidence that the model is producing reliable results. 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. Egg 120% margin is an invalid assumption. Testing should always be carried out by an independent third party.Re-computing the results and comparing with test results. This includes doing an environment check where one checks the ability of the model to work on a particular computer. the time and resource spent testing the model is time and money well spent. Formula tests –checking if formulae are calculating results properly Numeric tests. Types of tests are: • • • • Specification test – checking if model meets specifications. 17 .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. memory or network. Robustness Test -The tester needs to consider all of the feasible circumstances under which the model may be used in future.

Relative and absolute references • Another commonly found error is caused by confusion between relative and absolute references. Copied down a column it will change to D5. • 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. you know that every formula that refers to column D should contain an absolute reference. while references to others columns should always be relative. but insert a row immediately above or below the block and the new row will be omitted. Formulae not copied • Forgetting to copy the new formula across into the other cells in the row. You can also use semi-absolute references of the form $D4 or D$4. D6. such as $D$4. Remember that a cell reference in a formula of the form ‘=D4’ will change if you copy the formula across the row to E4. it is inevitable that you will make mistakes and refer to the wrong cell.Financial Modelling in Excel (v2007) Common errors © Celsoft Corporation With experience. If you always use column D for constants. F4 and so on. and the formula will automatically adjust to include the extra row. If you use the reference ‘=$D$4’ it will not change when copied across or down. you can learn to spot many of the most common spreadsheet errors very quickly. Sum over the wrong range • 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. for example E3. 18 . With the quantity of references in any large spreadsheet. Wrong reference • Nearly every formula in a spreadsheet refers back to another input or calculation. etc.

and • Control the evolution of the model when further changes are required.Financial Modelling in Excel (v2007) Unit errors © Celsoft Corporation Mixing up the appropriate units for the elements in a calculation is another frequently occurring problem. the date and time of printing. USE A best practice spreadsheet model is a powerful tool. Techniques for running scenarios 19 . the model user’s name. Headers and footers Putting key information onto report headers and footers makes it much easier to keep track of different model runs. not just print out numbers. but also improves the perception of the quality of the underlying model. Especially common is confusion between the order of magnitude for inputs. Without them. but to realize its usefulness you need to understand how to: • • Present useful information to help make decisions. Presenting results • A big difference to the usefulness of a model can be made by effective presentation of results. Include on the header or footer: • • • the model file name and/or the model name and version number. Good presentation leads not just to easier communication of the results. such as £s versus £000s. Present sensitivities and scenarios to understand the important drivers in the business. it is easy to mix up out of date versions of model output with the correct version.

Simulation What do we mean by "simulation?" When we use the word sim ulation . in a way that realistically reflects the range of possible outcomes that may occur in practice. of which there may be many.Financial Modelling in Excel (v2007) © Celsoft Corporation Spreadsheet models are powerful tools for analysis. A simple approach that is often used is to set all the sensitivities to the worst case. Spreadsheet risk analysis uses both a spreadsheet model and simulation to automatically analyze the effect of varying inputs on outputs of the modeled system. not just to generate computer printouts. 20 . in reality. we refer to any analytical method meant to imitate a reallife system. especially when other analyses are too mathematically complex or too difficult to reproduce. However. and look at the results that this gives. Using a model to produce useful information requires skill. Without the aid of simulation. a spreadsheet model will only reveal a single outcome. Monte Carlo simulation is often used in business for risk and decision analysis. generally the most likely or average scenario. which randomly generates values for uncertain variables over and over to simulate a model. by doing this the downside of the project is vastly over-stated. 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. Monte Carlo Simulation One of the problems with carrying out sensitivity analysis is combining the individual sensitivities in the model. fluctuations. One type of spreadsheet simulation is Monte Carlo simulation. it is unlikely that everything will go wrong together. It is very easy to understand how your input assumptions affect the results by using Data tables. A successfully developed model can analyse a variety of alternative situations and inform the decision making process. and other uncertain factors. to help make decisions given uncertainties in market trends.

or probable. The technique of Monte Carlo analysis overcomes these problems: it allows the user to combine many sensitivities in many different ways. Graphs are frequently valuable as a way to introduce information. 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. effectively running hundreds. the resultant outcome is. disjointed and difficult for management and decision 21 . Spreadsheet Modelling Best Practice and Standards The Need for Standards & Conventions As spreadsheet modelling activities and underlying organizations grow and become more complex. In the absence of universal spreadsheet modelling standards the spreadsheet modelling sector would continue to become more complex. and how probable each is. of scenarios. This problem would require advanced risk analysis software like Risk Solver or Risk Analyser to solve. Bear in mind that different people in your audience may have different needs. a lack of generally accepted principles governing the model development process has resulted in model developers constructing models according to individual tastes and preferences.Financial Modelling in Excel (v2007) © Celsoft Corporation Even if realistic combinations of sensitivities are used. this method makes clear the risks involved in the project. Traditionally. or even thousands. Graphs Graphs allow faster assimilation of information than a page of numbers. The output shows the range of possible results. but usually need to be supported by the actual numbers. This information enables the user to understand the effect that variations in the inputs have on the output: in other words. 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. A common mistake is to use an inappropriate type of graph for the message you want to present. simply applying these in the model do not provide any information about how likely. the need for universal spreadsheet modelling standards and accountability behind decision-making processes also grows.

Despite this lack of standardization. In this regard. In general. Some of the more prominent examples include accounting standards and auditing standards. Standards currently govern many areas of the business world. the primary spreadsheet modelling benefits of adopting these Standards and Conventions are: a) Improved quality & transparency b) Decreased development time & cost c) Minimization of error risk d) Facilitation of efficient sharing of model development methodologies e) Prevention of model redundancy f) Alignment of the needs of model developers & model users 22 . 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. unnecessarily creating significant costs and risks for business organizations.Financial Modelling in Excel (v2007) © Celsoft Corporation makers to control. but very little standardization in relation to forecasted results. there was little or no standardization within the spreadsheet modelling sector. 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. Prior to the first release of these Best Practice Spreadsheet Modelling Standards. there is considerable standardization of reporting and analysis in relation to historical results.

Clicking an item in the Tab list changes the ribbon that’s displayed. INTRODUCING EXCEL 2007 Excel. Here are just a few of the uses for Excel: Number crunching: Create budgets. and perform just about any type of financial analysis you can think of. Organizing lists: Use the row-and-column layout to store lists efficiently. but Excel is by far the most popular and has become the world standard.Financial Modelling in Excel (v2007) © Celsoft Corporation GETTING STARTED WITH MICROSOFT EXCEL 2007 Objectives Introduce Microsoft Excel 2007 citing the major changes from earlier versions. Other spreadsheet programs are available. Understand some of the basic efficiency functionalities in Microsoft Excel. 23 . Automating complex tasks: Perform a tedious task with a single mouse click with Excel’s macro and Visual Basic Application (VBA) capabilities. analyze survey results. is the world’s most widely-used spreadsheet program. and is part of the Microsoft Office suite. Parts of the Excel Screen That You Need to Know Name Quick Access Toolbar Ribbon Description A toolbar that you customize to hold commonly-used commands The main location to find Excel’s commands. as you probably know. Accessing other data: Import data from a wide variety of sources. Creating graphics and diagrams: Use Shapes and the new SmartArt to create professionallooking diagrams. Creating charts: Create a wide variety of highly customizable charts. Understanding the Excel environment.

THE QUICK ACCESS TOOLBAR In previous versions of Excel. and selecting “Customize Quick Access Toolbar…” 24 . the QAT contains three tools: Save. Traditional menus and toolbars are gone. 1 Ribbon tabs The commands available in the Ribbon vary. By default. of course. Undo. The Ribbon is arranged into groups of related commands. you see a drop-down menu with some additional commands that you might want to place in your QAT. the only end user customization option is the Quick Access Toolbar (QAT). Excel has commands that aren’t available in the Ribbon. In addition to the standard tabs. right-click the command and choose Add to Quick Access Toolbar. and they’ve been replaced with the Ribbon. Right-click the QAT and select Show Quick Access Toolbar below Ribbon. the only way to access these commands is to add them to your QAT. the QAT appears on the left side of the title bar. In most cases. you can display the QAT below the ribbon.Financial Modelling in Excel (v2007) Introducing the Ribbon © Celsoft Corporation The most dramatic change in Office 2007 is the new user interface. and Repeat. If you click the downward-pointing arrow to the right of the QAT. depending upon which tab is selected. Normally. It is accessed by right-clicking on any menu tab. Now. customize the QAT by adding other commands that you use often. and it remains to be seen whether it will catch on and replace traditional menus and toolbars. Excel 2007 also includes contextual tabs. a table. Things have changed in Excel 2007. or a SmartArt diagram) is selected. end users were free to customize their menus and toolbars. Alternatively. specific tools for working with that object are made available in the Ribbon. You can. Office 2007 is the first software in history to use this new interface. To add a command from the Ribbon to your QAT. Whenever an object (such as a chart.

Financial Modelling in Excel (v2007) © Celsoft Corporation Note the following: 1. Tools can be removed from the Quick Access Toolbar by right-clicking them EXERCISE – CUSTOMISING THE QUICK ACCESS TOOLBAR The tools shown below will be useful during the course insert these tools onto your Quick Access Toolbar if not already there: 25 . 3. You can select from a category of commands (the list below shows the “All Commands” category 2. The down and up arrows on the right-hand side of the dialogue boxes are used for repositioning the tools in your toolbar.

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

INSTALLING THE REQUIRED ADD-INS

Two add-in programs will be required during the course • Solver Add-in

To install these two add-ins, proceed as follows: 1. Click on the Office button. Select "Excel Options"/Add-Ins 2. Select Analysis Toolpak 3. Click GO 4. In the dialogue box presented tick “Analysis Toolpak” 5. Do the same for Solver Add-in Excel 2003 - To install these two add-ins, proceed as follows: 1. Select Tools/Add-ins 2. Click on the Analysis Toolpak and Solver-Addin check boxes

26

Financial Modelling in Excel (v2007)

© Celsoft Corporation

Selected Useful Keyboard Shortcuts

Application Fast and efficient use of Excel tools.

Ctrl A Ctrl B Ctrl C Ctrl D Ctrl F Ctrl G Ctrl H Ctrl I Ctrl K Ctrl N Ctrl O Ctrl P Ctrl R Ctrl S Ctrl U Ctrl V Ctrl X Ctrl Z Ctrl Pg Dn Ctrl Pg Up Ctrl Arrow Ctrl End Ctrl Home Ctrl 1 Ctrl F3 Ctrl ~

Select entire sheet Bold Copy Fill down Find Go to Replace Italics Hyperlink New sheet Open file Print Fill right - Copy the formula from the cell on the left of the active cell Save Underline Paste Cut Undo Move to the next sheet Move to the previous sheet Move to the end of the row (or column) in the direction of the arrow Go to bottom right-hand corner of spreadsheet Go to cell A1 Format cells Define a name – Name Manager Display the formulas in the worksheet

27

Financial Modelling in Excel (v2007)

© Celsoft Corporation

EXCEL’S BASIC EFFICIENCY TOOLS 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

You can assign any worksheet cell or range a name and then use that name in a formula.Insert/Names/Define) or by clicking in the Name box and typing in the name. Reasons: • • • Ease of reference Required by certain functions. Manually. 29 . Using other Excel techniques including referencing in VBA. (2003 . Makes model auditing easy. with the command Formulas/Defined Names/Define Name.Financial Modelling in Excel (v2007) © Celsoft Corporation Naming Cells & Ranges Benefits Efficient referencing of a cell Readable formulas that simply model auditing and testing.

and directing Excel to use the column headings and/or row titles to name the columns and/or rows of data. issue the commands Formulas. Here’s how to accomplish this: • Locate your list in some area of the worksheet. Supply a name for the range when prompted. 30 . you can also make use of a special range-naming option: Name a range by using a formula. with the commands Formulas/Defined Names/Create from Selection (2003 . three column list. However. Without having selected the list. Define Name to open the “Define Name” dialog. Name. if you name the range using a dynamic formula. A name cannot have two words and the same name cannot be used twice in the same workbook. 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. and the name will always refer to the entire set of data. However.Insert/Names/Create). You can do this with the command Formulas. Select the names you want to use from the Apply Names Using a Formula to Name a Range Dynamically The section above (Naming Cells & Ranges Used in Formulas) describes the usual methods used to create names in a worksheet. Define Name. the formula will adjust when the range length adjusts. you need to explicitly tell Excel to use the names in the formulas. 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.Financial Modelling in Excel (v2007) © Celsoft Corporation Automatically. If you name cells or ranges after you’ve already used their values in formulas. Below is a simple. • • The current list is in the range B5:D9. You don’t want to have to rename the range each time its length changes. Apply Names or Insert. Apply in 2003.

The fourth argument tells how many rows belong in the range.Financial Modelling in Excel (v2007) © Celsoft Corporation • • • In the example above. but instead.0. If more or fewer values are included in the B column. COUNTA(Sheet1!$B:$B). 31 . use the COUNTA function. The fifth and final argument tells how many columns to include in the range. B5. since B is the first column of the range. COUNTA(Sheet1!$B:$B) will keep track of them. In the “Refers to” box. Note also that the sheet name is included and the column B reference is absolute. Note that the sheet name is included in this reference and the reference to the anchor cell is absolute. enter not the reference to the current range (B5:D9). we move zero columns. The formula will take this format: =OFFSET(Sheet1!$B$5. Supplying the COUNTA function with the reference $B:$B indicates that it should count all the occupied rows in the B column. Instead of providing a static value here. we move zero rows. In our example. The third argument indicates how many columns to the right to move from the offset cell to begin the range. a formula that will dynamically define the range. It’s important not to have extraneous data beneath the dynamic range. In our example.3) How the formula works: The first argument of the OFFSET function is the anchor cell: In our example. 0. I supplied the name MyRange. either a data cell or the first header cell if your list has headers. This cell should be the upper-left-hand cell in the range. since 5 is the first row of the range. The second argument indicates how many rows down to move from the offset cell to begin the range.

Because a dynamic named range is dependent on calculation. Excel adjusts the cell references in your source formula when the formula is copied to a new location. That is. For copied formulas Excel uses relative addressing as the default. you must understand Excel’s relative and absolute addressing. Absolute: The row and column references do not change when you copy the formula because the reference is to an actual cell address. Or you can use a handy shortcut: the F4 32 . Define Name. However it will not appear in the list of names in the drop-down Name Box on the formula bar. Copying formulas: relative and absolute addressing 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. If you copy a formula. it can only be referenced in an open workbook. and the other is absolute.Financial Modelling in Excel (v2007) Notes: © Celsoft Corporation A dynamic range name constructed in this way will appear in the list of worksheet range names when you choose Formulas. Specify absolute addressing with a dollar sign (an arbitrarily selected symbol) before the row reference and the column reference. absolute or mixed) manually by inserting dollar signs in the appropriate positions of the cell address. It’s most efficient to build the formula one time and then copy it to the other locations where you need it. 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. 11 You can enter non-relative references (that is. Mixed: Either the row or column reference is relative.

select the cell or range and then use the Protection tab of the Format Cells dialog box To display this dialog box. but the formulas can’t be changed.1 Unlocking cells • In many cases. When you’ve entered a cell reference (by typing it or by pointing). One reason is to prevent yourself or others from accidentally deleting formulas or other critical data. To change the locked attribute. 33 . you will want to allow some cells to be changed when the worksheet is protected. Remove the check mark from Locked and click OK. right-click the cell or range and choose Format Cells from the shortcut menu (or press Ctrl+1). and that attribute determines whether the cell can be changed when the sheet is protected. Excel displays the Protect Sheet dialog box • Note that providing a password is optional. To understand workbook protection and its effects. none of the cells on the worksheet can be modified. If you enter a password. you can press F4 repeatedly to have Excel cycle through all four reference types. Every cell has a Locked attribute. all cells are locked. In such a case. • • • Excel users protect a worksheet for a variety of reasons. If you accept the default options in the Protect Sheet dialog box. your worksheet may have some input cells that are used by formula cells. FIGURE 31. For example. but not the formula cells. activate the worksheet and choose Review ➪ Changes ➪ Protect Sheet.Financial Modelling in Excel (v2007) © Celsoft Corporation key. you would want the user to be able to change the input cells. To protect a worksheet. that password will be required to unprotect the worksheet. A common scenario is to protect a worksheet so that the data can be changed. • • By default. Worksheet Protection Objectives To understand how to protect formula cells and leave input cells editable To understand how to assign permissions to users.

the user can make changes to objects (such as Shapes) and charts. Insert rows: If checked. This setting is checked. the user can delete columns. the user can insert hyperlinks (even in locked cells). Use PivotTable reports: If checked. the user can hide or change the width of columns. • • • • • • • • • • • • • • Select locked cells: If checked. the user can hide or change the height of rows. the user can apply formatting to locked cells. Sort: If checked. Insert hyperlinks: If checked. Delete rows: If checked. by default. Format columns: If checked. by default. Format cells: If checked. the user can insert new columns. which determine what the user can do when the worksheet is protected. the user can insert new rows. Delete columns: If checked. This setting is checked. the user can sort data in a range (as long as the range doesn’t contain any locked cells). Edit objects: If checked. the user can use existing auto filtering. choose Review ➪ Changes ➪ Unprotect Sheet. the user can delete rows.Financial Modelling in Excel (v2007) © Celsoft Corporation 31 To unprotect a protected sheet. as well as insert or delete comments. the user can select unlocked cells using the mouse or the keyboard. Select unlocked cells: If checked. If the sheet is protected with a password. Sheet protection options The Protect Sheet dialog box has several options. the user can change the layout of pivot tables or create new pivot tables. Use AutoFilter: If checked. Format rows: If checked. the user can select locked cells using the mouse or the keyboard. 34 . Insert columns: If checked. you’re prompted to enter the password.

Then follow the prompts in the series of dialog boxes that follow. if desired. You can specify which users can edit a particular range while the worksheet is protected. To unprotect the workbook’s windows. you can require a password to make changes. FIGURE 31. As an option. Then choose Review ➪ Changes ➪ Allow Users To Edit Ranges. Start by unprotecting the worksheet if it’s protected. you are prompted to enter the password. 4. Choose Review ➪ Changes ➪ Protect Workbook. the user can’t change anything related to the window size or position. choose Review ➪ Changes ➪ Unprotect Workbook. When a workbook’s windows are protected. In the Protect Workbook dialog box. the user can use scenarios (see Chapter 36). the user cannot unmaximize the window. however. Make sure that you protect the sheet as the final step.4. This feature is rarely used. be zoomed. and the setup procedure is rather complicated. For example.Financial Modelling in Excel (v2007) • © Celsoft Corporation Edit scenarios: If checked. Assigning User Permissions Excel also offers the ability to assign user-level permissions to different areas on a protected worksheet. But if you need this level of protection. place a check mark next to Windows. if the workbook window is maximized when the windows are protected. Protecting a workbook’s windows To prevent others (or yourself) from changing the size or position of a workbook’s windows. you can protect the workbook’s windows: 1. which displays the dialog box shown in Figure 31.9 35 . setting it up is worth the effort to get it. Enter a password. 2. Click OK. If the workbook’s windows were protected with a password. 3. The windows can.

Financial Modelling in Excel (v2007) DATA MANAGEMENT TOOLS © 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. 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 Go to Data\Data Tools\Data Validation\Data validation (2007) or. accidentally or intentionally. Data\Validation in 2003 Validation can be performed on data in a cell according to the validation criteria shown in the box below.g. To prevent entering of invalid input that will lead the model to producing ridiculous results e. margin of 120% or decimals of human beings. 36 . Validating data & producing drop-down lists Application Prevent invalid typing into particular cells.

you can specify that the entered data must be greater than or equal to January 1. Select the relevant cells on the spreadsheet 2. 2007. For example. 37 . List: The user must choose from a list of entries you provide. along with the “error alert” symbol that should be displayed. you can specify that the length of the entered data be 1 (a single alphanumeric character). You specify a valid range of numbers by using the Data drop-down list. and less than or equal to December 31. You specify a valid range of whole numbers by using the Data drop-down list. you can specify that the entry must be a whole number greater than or equal to 100. Select the desired validation criteria Types of Validation Criteria You Can Apply Any Value: Selecting this option removes any existing data validation. you can specify that the entered data must be greater than 12:00 p. you can specify that the entry must be greater than or equal to 0 and less than or equal to 1. For example. Date: The user must enter a date. For example. You specify a valid date range by using the Data drop-down list. Whole Number: The user must enter a whole number. You specify a valid time range by using the Data drop-down list. For example. To prevent invalid data being entered into the spreadsheet: 1. Text Length: The length of the data (number of characters) is limited. Time: The user must enter a time. Open the Data validation dialogue box 3. For example. You specify a valid length by using the Data drop-down list. Decimal: The user must enter a number. 2007.Financial Modelling in Excel (v2007) © Celsoft Corporation One can also select the message that should be displayed if invalid data is entered.m.

Open the Data validation dialogue box. circles appear around cells that contain incorrect entries. a message box appears that displays the message specified in the Error Alert tab of the Data Validation dialog box.Financial Modelling in Excel (v2007) © Celsoft Corporation Custom: To use this option. The formula that you specify must be a logical formula that returns either True or False. In the “Allow” box. the circle disappears. When you click this item. select “List” 4. the data validation feature is quite straightforward and easy to use. choose Data ➪ Data Tools ➪ Data Validation ➪ Clear Validation Circles. You can enter the formula directly into the Formula control. To present the user with a drop-down box containing a list of input choices for the current cell: 1. or you can enter a reference to a cell that contains a formula. either in the form of cell addresses or a range name (if you named the column of choices). To get rid of the circles. 38 . or you can specify a cell reference that contains a formula. Select the cells on the spreadsheet for which this list of choices is applicable 3. You can enter the formula directly into the Formula control (which appears when you select the Custom option). If the formula evaluates to True. If the formula that you enter into the Data Validation dialog box contains a cell reference. But the real power of this feature becomes apparent when you use data validation formulas. If the formula evaluates to False. you must supply a logical formula that determines the validity of the user’s entry (a logical formula returns either True or False). based on the upper-left cell in the selected range. Using Formulas for Data Validation Rules For simple data validation. 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. In the “Source” box now presented. In a column on the spreadsheet list the choices for the input cells concerned 2. This creates what is termed an in-cell drop down list. the data is considered valid and remains in the cell. If you correct an invalid entry. enter the column of choices. that reference is considered a relative reference. Note that the range or name should be preceded by an =. Encircle Invalid Data The Data ➪ Data Tools ➪ Data Validation drop-down control contains an item named Circle Invalid Data.

A1)=1 This formula assumes that A1 is the active cell in the selected range. Note that the first argument for COUNTIF is an absolute reference. use the following data validation formula: =ISTEXT(A1) This formula assumes that the active cell in the selected range is cell A1. Accepting no duplicate entries only The following data validation formula does not permit the user to make a duplicate entry in the range A1:C20: =COUNTIF($A$1:$C$20. Note that you can’t use this formula for a cell in row 1. 39 .Financial Modelling in Excel (v2007) © Celsoft Corporation Data Validation Examples Example: Data validation examples.xlsx. It uses the WEEKDAY function. which returns 1 for Sunday. 2 for Monday. To force a cell or range to accept only text (no values). Accepting a larger value than the previous cell The following data validation formula enables the user to enter a value only if it’s greater than the value in the cell directly above it: =A2>A1 This formula assumes that A2 is the active cell in the selected range. =WEEKDAY(A1)=2 This formula assumes that the active cell in the selected range is cell A1. Accepting text only Excel has a Data Validation option to limit the length of text entered into a cell. and so on. and the date is a Monday. The second argument is a relative reference. and it adjusts for each cell in the validation range Accepting only a date that’s a Monday The following Data Validation formula ensures that the cell entry is a date.

It displays the Advanced Filter dialog box instead of the AutoFilter menu. To merely display required data (filter the database).called AutoFilter. To remove the AutoFilter arrows. Microsoft Office Excel uses the separate criteria range in the Advanced Filter dialog box as the source for the advanced criteria. Searching a database in Excel is known as "Filtering". Click the arrow button in the column in which you want to search for data. 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. again select the commands Data/Sort & Filter/Filter.called Advanced Filter. Excel provides us with a means of filtering data "automatically" . choose 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.Financial Modelling in Excel (v2007) Accepting only values that don’t exceed a total © Celsoft Corporation The following Data Validation formula ensures that the sum of the budget items does not exceed the budget: =SUM($B$1:$B$6)<=$E$5 Filtering & Advanced Filtering Application Understand how to filter data and drill down to select the data one wants to see. 40 . or creating filters (criteria) and storing results in a more permanent manner . and choose from the selection list displayed. This will cause arrow buttons to be displayed at the top of each column. Understand how to filter data using various dimensions either on the same place or extracting the selection required.

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. click the Show Formulas button. however. press CTRL+` (grave accent). one column. in the Formula Auditing group. To indicate an equality comparison operator for either text or a value. A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Type B Salesperson C Sales Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Because the equal sign (=) is used to indicate a formula when you type text or a value in a cell.Financial Modelling in Excel (v2007) © Celsoft Corporation To switch between viewing the results and viewing the formulas that return the results. For example: What you type in the cell ="=Davolio" ="=3000" What Excel evaluates and displays =Davolio =3000 Multiple criteria. or on the Formulas tab. this may cause unexpected filter results. Excel evaluates what you type. any criteria true 41 .

type the criteria directly below each other in separate rows of the criteria range. 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. To find rows that meet multiple criteria for one column. Make sure that there is at least one blank row between the criteria values and the list range. The criteria range must have column labels. To filter the list range by copying rows that match your criteria to another area of the worksheet. click Advanced. click Copy to another location. In the example. you can specify which columns to include in the copy operation. In the example. Before filtering. A6:C10. click Filter the list. you would enter: A 1 2 3 Type B Salesperson ="=Davolio" ="=Buchanan" C Sales Click a cell in the list range. When you filter. 42 . Tip When you copy filtered rows to another location. enter a reference to the copied column labels in the Copy to box.Financial Modelling in Excel (v2007) Boolean logic: (Salesperson = "Davolio" OR Salesperson = "Buchanan") © Celsoft Corporation Insert at least three blank rows above the list range that can be used as a criteria range. The copied rows will then include only the columns for which you copied the labels. and then click the upper-left corner of the area where you want to paste the rows. you would click any cell in the range. click in the Copy to box. in-place. in the Sort & Filter group. Do one of the following: To filter the list range by hiding rows that don't match your criteria. On the Data tab.

you would enter: A 1 2 Type ="=Produce" B Salesperson C Sales >1000 In the Criteria range box. where any criteria can be true. where each set includes criteria for one column. include multiple columns with the same column heading. In the example. you would enter: A 1 2 3 Type B Salesperson C Sales >6000 <500 D Sales <6500 43 . all criteria true Boolean logic: (Type = "Produce" AND Sales > 1000) © Celsoft Corporation To find rows that meet multiple criteria in multiple columns.Financial Modelling in Excel (v2007) Multiple criteria. one column in all sets Boolean logic: ( (Sales > 6000 AND Sales < 6500 ) OR (Sales < 500) ) To find rows that meet multiple sets of criteria. In the example. enter the reference for the criteria range. multiple columns. Multiple criteria. multiple columns. you would enter $A$1:$C$2. any criteria true Boolean logic: (Type = "Produce" OR Salesperson = "Buchanan") To find rows that meet multiple criteria in multiple columns. type all of the criteria in the same row of the criteria range. In the example. In the example. including the criteria labels. you would enter: A 1 2 3 Type ="=Produce" ="=Buchanan" B Salesperson C Sales Multiple sets of criteria. type the criteria in the different columns and rows of the criteria range.

Min. Max. Outline Group. Other functions available include Count. Subtotals.Financial Modelling in Excel (v2007) Multiple sets of criteria. Drill down data to see the summary or the detail. Remove subtotals with Data. Excel can’t effectively subtotal unsorted data. Remove All. StdDev. Average. When you plan to use the Subtotal command. The dialog allows you to determine how the subtotal will be organized. Outline (Grouping & Ungrouping) Application Quickly summarize data by categories. 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. and Varp. Outline Group. Count Nums. 44 . Excel creates subtotals and puts them in an outline format so they can be easily collapsed for a summary view. Var. Choose the commands Data. Like the other list management features in Excel. The default subtotal function is sum. always first consider whether and how to use the Sort command. multiple columns in each set © Celsoft Corporation Boolean logic: ( (Salesperson = "Davolio" AND Sales >3000) OR (Salesperson = "Buchanan" AND Sales > 1500) ) A 1 2 3 Type B Salesperson ="=Davolio" ="=Buchanan" C Sales >3000 >1500 Subtotal. Subtotal to open the Subtotal dialog box. Product. StdDevp.

The Data Consolidate feature supports the following methods of consolidation: 45 . For example. Remove outlining from the spreadsheet with Data. it even works if the source worksheets aren’t laid out identically. When you consolidate data. The Outline view displays automatically after you use the Subtotal command. Or. select the data to outline and choose Data. Understand how to filter data using various dimensions either on the same place or extracting the selection required. and highest selling products for the entire enterprise. you might use a consolidation to roll up these figures into a corporate expense worksheet. Group and Outline. To summarize and report results from separate worksheets. and in some cases.Financial Modelling in Excel (v2007) Outline © Celsoft Corporation Excel provides a convenient outline feature that facilitates showing your data in summary or detail fashion. Auto Outline) or by hand. current inventory levels. This method is very flexible. The worksheets can be in the same workbook as the master worksheet or in other workbooks. use Excel’s Consolidate dialog box. This master worksheet might contain sales totals and averages. if you have a worksheet of expense figures for each of your regional offices. Group. For data consolidation. you can consolidate data from each separate worksheet into a master worksheet. To create an outline manually. Group and Outline. Group and Outline. Consolidate data in multiple worksheets Application Understand how to filter data and drill down to select the data one wants to see. An outline can encompass up to eight levels of detail. Make sure you insert your own summary rows with formulas immediately below or above each group of detail rows. Clear Outline. you can create an outline automatically (Data. This technique can create consolidations that are static (no link formulas) or dynamic (with link formulas). you are assembling data so that you can more easily update and aggregate it on a regular or ad hoc basis.

don’t include labels in the range.6 The Consolidate dialog box enables you to specify ranges to consolidate. which appears when you choose Data ➪ Data Tools ➪Consolidate. Sum is the most commonly used consolidation function. Use this option if the data is laid out differently in the source worksheets or if some source worksheets are missing rows or columns. Reference text box: Specify a range from a source file that you want to consolidate. All References list box: Contains the list of references that you have added with the Add button.Financial Modelling in Excel (v2007) • • © Celsoft Corporation By position: This method is accurate only if the worksheets are laid out identically. After you enter the range in this box. do include labels in the range. click the Add button to add it to the All References list. If you consolidate by position. The picture below shows the Consolidate dialog box. You can enter the range reference manually or use any standard pointing technique (if the workbook is open). Following is a description of the controls in this dialog box: FIGURE 27. 46 . but you also can select from ten other options. If you consolidate by category. Function list box: Specify the type of consolidation. By category: Excel uses row and column labels to match data in the source worksheets.

47 . Create Links to Source Data check box: When you select this option. Delete button: Deletes the selected reference from the All References list. To consolidate data. Add button: Adds the reference in the Reference box to the All References list. Browse button: Displays a dialog box that enables you to select a workbook to open. Excel adds summary formulas for each label and creates an outline.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 consolidation doesn’t use formulas. Use these options when you consolidate by category. Make sure that you click this button after you specify each range. and there are no blank rows or columns within the list. You’ll find that your job is much easier if all the workbooks to be consolidated are open. but use the same row and column labels so that the master worksheet can match the data Use a PivotTable report instead of a consolidation Use a PivotTable report to consolidate data Consolidate by category Then… Consolidate by position Consolidate by position 1. use the Consolidate command in the Data Tools group on the Data tab. the left column. Set up the data to be consolidated on each separate worksheet. and an outline isn’t created. It inserts the filename in the Reference box. but you have to supply the range reference. Make sure that each range of data is in list format: each column has a label in the first row and contains similar facts. or both positions. What do you want to do? If you want to… Arrange the data in all worksheets in identical order and location Organize the data differently in the separate worksheets. If you don’t select this option.

The file path is entered in the Reference box followed by an exclamation point. In the Function box. If the worksheet is in another workbook. click the arrow next to Name a Range. Don't put any of the ranges on the worksheet where you plan to put the consolidation. 5. Repeat this step for each range. NOTE Make sure that you leave enough cells to the right and below this cell for the consolidated data. 3. and then click OK to close the Browse dialog box. click the summary function that you want Microsoft Office Excel to use to consolidate the data. Do one of the following: To set up the consolidation so that it updates automatically when the source data changes. and then click Add. and type a name for the range in the Name box. The Consolidate command populates the area as needed.Financial Modelling in Excel (v2007) © Celsoft Corporation Put each range on a separate worksheet. Decide how you want to update the consolidation. On the Data tab. 6. Make sure that each range has the same layout. Click the upper-left cell of the area where you want the consolidated data to appear in the master worksheet. 4. Type the name that you gave the range. in the Data Tools group. you won't be able to change which cells and ranges are included in the consolidation. click Consolidate. Name each range: Select the entire range. 7. click Browse to locate the file. 2. select the Create links to source data check box. Once you select this check box. and then on the Formulas tab in the Named Cells group. IMPORTANT You can only select this check box if the worksheet is in another workbook. 48 .

shows three single-sheet workbooks that will be consolidated. Use the Function drop-down list to select the type of consolidation summary that you want to use.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. An example The simple example in this section demonstrates the power of Excel’s Data Consolidate feature. These worksheets report product sales for three months.xlsx. that they don’t all report on the same products.xlsx. Use Sum for this example. region2. Creating consolidation formulas manually would be a very tedious task.xlsx. Excel does not copy the row or column labels in the source ranges to the consolidation. copy them from one of the source ranges or enter them manually. or both. 49 . 8. Make sure that any categories that you don't want to consolidate have unique labels that appear in only one source range. but consolidation is easier if they are open. In addition. the Left column. In other words. Leave the boxes under Use labels in blank. and region3. Notice. Use workbooks The files are named region1. however. 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. If you want labels for the consolidated data. Excel displays its Consolidate dialog box. To consolidate this information. You don’t need to open the source workbooks. the products aren’t even listed in the same order. NOTES Any labels that don't match up with labels in the other source areas result in separate rows or columns in the consolidation. start with a new workbook. these worksheets aren’t laid out identically. Follow these steps to consolidate the workbooks: Choose Data ➪ Data Tools ➪ Consolidate. clear the Create links to source data check box.

Enter the reference for the third worksheet. Understand how to display formulas on screen instead of their cell results 50 .Financial Modelling in Excel (v2007) © Celsoft Corporation Enter the reference for the first worksheet to consolidate. This final reference is added to the All References list. If the workbook is open. You can use a range that includes complete columns. verify that the ranges are correct. and click OK. Because the worksheets aren’t laid out the same. check cell dependents and precedents. This reference is added to the All References list. The reference must include a range. click the Browse button to locate the file on disk. Enter the reference for the second worksheet. This range is larger than the actual range to consolidate. or you can simply edit the existing reference by changing Region1 to Region2 and then clicking Add. When the reference in the Reference box is correct. you can edit the existing reference by changing Region2 to Region3 and then clicking Add. Again. Formula Auditing Application Understand how to trace errors. Just display the Consolidate dialog box. you can point to the reference. you don’t have to re-enter the references. You can point to the range in the Region2 workbook. select the Left column and Top row check boxes to force Excel to match the data by using the labels. click Add to add it to the All References list. such as A:K. Click OK to begin the consolidation. but using this range ensures that the consolidation will still work if new rows and columns are added to the source file. Select the Create Links to Source Data check box to make Excel create an outline with external references. Refreshing a consolidation If you want to refresh a consolidation later. If it’s not open.

a circular reference occurs when a formula mistakenly refers to itself and thus can't be resolved. Conditional formatting works a little differently in Excel 2007. Use the Remove Arrows icon or the erase dependent arrows icons to erase the arrows when you're through. Click the problem cell and use the Trace Error button on the Auditing Toolbar to locate the error. The Conditional formatting command sequence is: Home/Styles/Conditional formatting This will bring up the following dialogue box 51 . Click the cell whose dependents or precedents you want to locate and use the trace precedents or trace dependents icons on the Auditing Group. Excel draws arrows on the worksheet to show relationships between cells. and quite a few enhancements have been made. Creating conditional formats in Excel 2007 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.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 Use Excel's Auditor to Correct Problems and Examine Cell Relationships For example.

option on the previous page. • To format a cell according to a formula.Financial Modelling in Excel (v2007) • And selecting the first item on the menu will expand the dialogue box to: © Celsoft Corporation • And again selecting the first item “Greater than…” will bring up the dialogue box allowing you to format the cell according to its contents. one would select the “More rules…”. The following dialogue box will appear 52 .

53 . the average. is greater than.Financial Modelling in Excel (v2007) © Celsoft Corporation Creating conditional formats in Excel 2007 (contd) Thus in Excel 2007. or below. occurs between two dates) Values in a range are duplicated (or are unique) Values fall within the top x number of values or the bottom x number of values. equal to.g. less than. contains a string of text. falls between certain values. a desired format can be applied to cells if: • • • • A cell meets certain specified criteria (e. Cells can be highlighted according to their values (called data bars) or can be flagged with icons depending on where their values fall. or are above.

such as + (for addition) and * (for multiplication) Cell references (including named cells and ranges) Values or text Worksheet functions (such as SUM or AVERAGE) Formulas always begin with the equal sign so that Excel can distinguish them from text. When data changes. Understanding Formula Basics A formula can consist of any of these elements: • • • • • Mathematical operators. Formula Basics Formulas are what make a spreadsheet program so useful. We introduce formulas and functions that will help you get up to speed with this important element. Using operators in formulas Operators Used in Formulas Operator + – * / Name Addition Subtraction Multiplication Division 54 . those formulas calculate updated results with no extra effort on your part.Financial Modelling in Excel (v2007) © Celsoft Corporation EXCEL FUNCTIONS Objectives Understand various Excel functions and learn how to apply them in different modeling scenarios. You use formulas in your Excel worksheets to calculate results from the data stored in the worksheet.

it returns FALSE. 55 .Financial Modelling in Excel (v2007) ^ & = > < >= <= <> 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) © Celsoft Corporation You can. If cell A1 contains 123 and cell A2 contains 456. Returns TRUE if the value in cell A1 isn’t equal to the value in cell A2. this formula would return the value 123456. =A1&A2 Concatenates the contents of cell A1 with cell A2. the formula would return TRUE. What It Does Formula =”Part-”&”23A” Joins (concatenates) the two text strings to produce Part-23A. Otherwise. =A1<=A2 =A1<>A2 Returns TRUE if the value in cell A1 is less than or equal to the value in cell A2. it returns FALSE. Otherwise. of course. Following are some examples of formulas that use various operators. You need to understand these rules if you want your formulas to produce the desired results. Logical-comparison operators also work with text. because Bill comes before Julia in alphabetical order. Otherwise. Returns the cube root of 216 (6). Concatenation works with values as well as text. If A1 contained Bill and A2 contained Julia. it returns FALSE Understanding operator precedence in formulas When Excel calculates the value of a formula. use as many operators as you need to perform the desired calculation. Returns TRUE if the value in cell A1 is less than the value in cell A2. it uses certain rules to determine the order in which the various parts of the formula are calculated. =6^3 =216^(1/3) =A1<A2 Raises 6 to the third power (216).

=(B2-B3)*B4 Compare with the following formula without parentheses: =B2-B3*B4 You can also nest parentheses within formulas—that is. E. Operator Precedence in Excel Formulas Symbol ^ * / + – & = < > Operator Exponentiation Multiplication Division Addition Subtraction Concatenation Equal to Less than Greater than Precedence 1 2 2 3 3 4 5 5 5 You can use parentheses to override the Excel’s built-in order of precedence.Financial Modelling in Excel (v2007) © Celsoft Corporation The table below lists the Excel operator precedence. Excel displays a message explaining the problem—and won’t let you enter the formula. Excel may propose a correction to your formula. of course.g. Here’s an example of a formula that uses nested parentheses: =((B2*C2)+(B3*C3)+(B4*C4))*B6 Every left parenthesis. keeping them straight can sometimes be difficult. This table shows that exponentiation has the highest precedence (it’s performed first) and logical comparisons have the lowest precedence (they’re performed last). must have a matching right parenthesis. Expressions within parentheses are always evaluated first. put them inside other parentheses. If the parentheses don’t match. If you have many levels of nested parentheses. In some cases. 56 . if your formula contains mismatched parentheses. If you do so. Excel evaluates the most deeply nested expressions first—and then works its way out.

Functions vary in how they use arguments. Using functions in your formulas Most formulas you create use worksheet functions. you’d have to construct a formula like this: =(A1+A2+A3+A4+A5+A6+A7+A8+A9+A10)/10 Not very pretty. A comma as a list-separator character The information inside the parentheses is called the list of arguments. 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. A formula must begin with an equal sign to inform Excel that the cell contains a formula rather than text. Depending on what it has to do. Fortunately. you can use the TAN function to calculate the tangent of an angle. For example. you can replace this formula with a much simpler one that uses one of Excel’s built-in worksheet functions: =AVERAGE(A1:A10) Syntax of Excel functions All the functions used parentheses.Financial Modelling in Excel (v2007) © Celsoft Corporation Excel’s Formula AutoCorrect feature often suggests a correction to an erroneous formula. a function may use: • No arguments 57 . you would need to edit this formula if you added another cell to the range. Examples of formulas that use functions A worksheet function can simplify a formula significantly. You can’t do this calculation by using only the mathematical operators. is it? Even worse. To calculate the average of the values in 10 cells (A1:A10) without using a function.

Some users feel a bit overwhelmed by the sheer number of functions. And if that’s not enough. but you’ll probably find that you use only a dozen or so. Excel includes 340 functions. Even if a function doesn’t use an argument. You can insert a function by selecting it from one of the function categories. 58 . like this: =NOW() More about functions All told. Excel’s Insert Function dialog box (described later in this section) makes it easy to locate and insert a function. 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. on a regular basis. And as you’ll see. The Function Arguments dialog box. you must still provide a set of empty parentheses.Financial Modelling in Excel (v2007) • • • • One argument A fixed number of arguments An indeterminate number of arguments Optional arguments © Celsoft Corporation An example of a function that doesn’t use an argument is the NOW function. which returns the current date and time. even if it’s not one that you use frequently.

3 Excel Error Values Error Value #DIV/0! #NAME? #N/A Explanation The formula is trying to divide by zero. This can happen if the cell has been deleted from the worksheet. VLOOKUP) can also return #N/A. This can happen if you delete a name that’s used in the formula or if you have unmatched quotes when using text. Some functions (for example.) A problem with a value exists. #NULL! #NUM! #REF! #VALUE! The formula uses an intersection of two ranges that don’t intersect. you specified a negative number where a positive number is expected. The formula refers to a cell that isn’t valid. The formula uses a name that Excel doesn’t recognize. An operand is a value or cell reference that a formula uses to calculate a result 59 .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 Common Formula Errors TABLE 11. The formula is referring (directly or indirectly) to a cell that uses the NA function to signal that data is not available. (This concept is described later in the chapter. by nothing). This also occurs when the formula attempts to divide by what’s in a cell that is empty (that is. The formula includes an argument or operand of the wrong type. for example.

In Automatic Calculation mode (which is the default mode). The Contributions cell contains the following formula: =5%*Net_Profit The Net Profit cell contains the following formula: =Gross_Income-Expenses-Contributions These formulas produce a resolvable circular reference. you may want to control when Excel calculates formulas. you’ll find that processing can slow to a snail’s pace while Excel does its thing. In such a case. indeed. suppose a company has a policy of contributing 5 percent of its net profit to charity. Excel keeps calculating until the Contributions value is. If the Enable Iterative Calculation setting is on. In other words. the result becomes increasingly accurate until it converges on the final solution. The contribution itself. however. set Excel’s calculation mode to Manual—which you can do by choosing Formulas ➪ Calculation ➪ Calculation Options ➪ Manual 60 . 5 percent of Net Profit. If you change any cells that the formula uses. Specifying when formulas are calculated You’ve probably noticed that Excel calculates the formulas in your worksheet immediately. Excel displays the formula’s new result with no effort on your part.Financial Modelling in Excel (v2007) Intentional Circular References © Celsoft Corporation You can sometimes use a circular reference to your advantage. All this happens when Excel’s Calculation mode is set to Automatic. For example. This produces a circular reference (see the accompanying figure). For example. Sometimes. if you create a worksheet with thousands of complex formulas. is considered an expense—and is therefore subtracted from the net profit figure. however.

ELSE take 0) For example: 61 . ELSE IF this condition is true.value_if_false) Here are some examples of logical statements in a spreadsheet system: =If(C6>=10000. © Celsoft Corporation Logical Functions The IF function It is often necessary in financial modelling to use logical tests in a model. else just pay the minimum commission of 1000."Cash") =If(B1<>B2. Excel’s other logical functions are AND. Excel’s IF function is probably the most important of the set of Excel’s logical functions. then calculate commission at 10% of the sales.g.value_if_true. The IF function checks a condition that must be either true or false. and the value to return if the condition is false. the function returns another value. the function returns one value. FALSE and TRUE. THEN take D1*D11. If sales are greater than target of 10 000. The syntax of the IF statement is: =IF(logical_test. a statement that reads: If this condition is true.1000) =If(B10<0. THEN take D1*D10. the value to return if the condition is true.C6*10%. Then. If the condition is true. ELSE IF this condition is true."Out of balance!". i. The IF function has three arguments: the condition you want to check. THEN take D1*D12."Overdraft".e. E. NOT. if the condition is false. else use that formula.Financial Modelling in Excel (v2007) You can control when Excel calculates formulas. OR. Else statement. In most modelling systems this is known as an If."") Nested Ifs Ifs can also be nested. then use this formula. For example you might have an IF statement that reads “IF(this condition is true.

use the SUMIF worksheet function. The NOT Function The NOT function changes a TRUE outcome to a FALSE one and vice versa. to count the number of occurrences of a string of text or a number within a range of cells. IF(Score>69. use the COUNTIF worksheet function. But the formula =AND(1<5. So =OR(1<5.10>2) evaluates to True. "F")))) Up to seven IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests. This function requires that all its arguments evaluate as true in order for AND to evaluate to True. the formula =AND(1<5. However. For example. The AND Function The AND function can handle up to thirty conditions that can evaluate to true or false. the OR function requires that only one of the arguments evaluate as true in order to return true. To calculate a sum based on a string of text or a number within a range. For example."D". Excel has additional functions you can use to analyze your data based on a condition.12<2) evaluates to True."B".12<2) evaluates to False. For example. The OR Function Like the AND function."A". a statement with more than one or two embedded IF functions is hard to read and may be unnecessarily complicated. the OR function can handle up to thirty conditions. IF(Score>79.Financial Modelling in Excel (v2007) © Celsoft Corporation IF(Score>89. =NOT(12>2) returns False. 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 ."C". IF(Score>59. However.

and there’s a close correspondence between the two. spinners. 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. These controls don’t require any special programming or definition other than what can be provided from within Excel itself. select “Controls”. controls from the Control Toolbox are more sophisticated. under Customize. To bring the Forms toolbox to the Excel ribbon. There are two categories of Excel controls you can choose from. it will now be accessible on the Quick access toolbar 63 . and other kinds of controls can make a worksheet easier for you and others to use. click Add and then OK. Once you add the control toolbox. Buttons. check boxes. Controls on the Forms toolbar are something of a holdover from earlier versions of Excel. Use a control from the Forms toolbar when you need a control to run a single macro or for a simple interactive worksheet. All commands.Financial Modelling in Excel (v2007) Introduction © Celsoft Corporation You can build a custom form for a worksheet by using Excel controls. In contrast. go to Excel Options. drop-down lists.

you could have a button for “Consider recruitment” or “Suspend recruitment”. The Check Box Used to collect True/False responses. and what its data entry limits might be. In addition. and 2) Format the control. The result of the check box status appears as TRUE or FALSE in the linked cell.FalseResult) 64 . For example. formatting can change a control’s protection status. =if(LinkCell. 3) Link a control to a cell Formatting a control determines what data is associated with the control. This control is often used with an IF function that examines the TRUE or FALSE status of the linked cell. Formatting a control is achieved by right clicking the control and then selecting “format control” and then the “Control” tab. in a budget model.Financial Modelling in Excel (v2007) © Celsoft Corporation Using Forms Toolbar Controls All the control buttons on the Forms toolbar work using the same two-part process: 1) Draw the control on the worksheet. For example. de-selection results in FALSE. how it moves when underlying cells are moved. The check box control is linked to a cell.TrueResult. The user’s selection of the check box results in TRUE.

The CHOOSE function can be used to turn the numeric choice into different results. so the user will be able to select only one button at a time. For example: =choose(LinkCell. the linked cell holds 1. The Group Box The result from a group of option buttons appears in one.Result1.Result2. all these buttons will belong to the same group. linked cell. but they look different to the user. type a title to replace the default box title.. if the first button is selected..Financial Modelling in Excel (v2007) © Celsoft Corporation Option Button Used most often to make a single choice from a group of options.Result3. While the box is selected. E.. 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. However. A combo box (drop-down or pull-down list) is only one item high and has a down-arrow at the right. Because only one linked cell exists for all option buttons in a group. selecting a depreciation method to use. and so on.) The List or Combo Box A list box and a combo (drop-down) box produce the same result. the linked cell holds 2. A list box shows multiple items in a list while the list itself stays the same height. To create list box or a combo box: 65 . To create a group of option buttons draw a group box with the group box tool. Clicking the arrow displays the list. If you draw several option buttons on a worksheet.g. If the second button is selected.

for example.1) =index($B$3:$C$7.Financial Modelling in Excel (v2007) © Celsoft Corporation 1. or use the INDEX function.$G$9. This cell is where the numeric position of the item the user selects will appear. assume that a list of items in the range B3:B7 is used for the range in the Input Range box. In another cell you can show the item selected with the formulae: =index($B$3:$B$7. The syntax of the index function is: =index(ItemList. Select the Input Range box and drag across the range in the worksheet that contains the list.ColumnNo) In our example.LinkCell. The item in that row of the list (1) is then returned to the cell that contains the index function. Enter one item per cell. Two-list lookup You can display details in another column by choosing from one list but use a corresponding value from another list. 5. The link cells for the list is C9 & E9. Select the Control tab. If you’re formatting a combo box.$E$9.g. After drawing the control. Right click the list and choose Format Control to display the “Format Control” tabbed dialog. 4. 2. 3. You could use this technique to look up items by name or description etc e. on the workings worksheet. enter in the Drop down Lines box the number of lines that should display when the list appears.2) This function looks down the list B3:B7 to the row specified in C9. Displaying the selection The result of a selection from a list is the number that’s the position of the selected item in the list. in our example in the list box we are selecting the day in order to pick the corresponding % 66 . If a user selected the second item in the list. If you want to convert this number into an actual item in the list. Select the Cell Link box and click the cell that will receive the results of the list. use the CHOOSE function described earlier. the linked cell holds 2. enter a column with the items you want to appear in the list. This is the list that will appear in the list box or combo box.

Holding down the mouse button on a spinner makes it change continuously. and it’s the list the user sees. Notice the formula on top. the user can drag the square button in the scroll bar. (The Page Change box isn’t used for spinner control. On the “Format Control” tabbed dialog. The Spinner A spinner increases or decreases the amount in the cell linked to it. Like a spinner. The scroll bar can be drawn to operate vertically or horizontally. The other is used to find the result you want to retrieve and have appeared in the worksheet. 2. 4. In the Current Value box. To set scroll bar defaults: The Command Button 67 . you need two lists. To set the defaults and limits on a spinner control: 1. enter the amount you want the linked cell to have by default when the worksheet opens. enter the lowest value you want the spinner to produce. To enter a number.Financial Modelling in Excel (v2007) © Celsoft Corporation To use a two-list lookup. Right-click the spinner control and choose the Format Control command. Note that using a spinner can cause a great deal of recalculation in a worksheet unless you control worksheet recalculation deliberately. Or. enter the highest. lets a user select from a wide range of numbers while getting a visual impression of where their entry lies within the possibilities. The Scroll Bar A scroll bar.) 5. a scroll bar can cause a great deal of recalculation in a worksheet unless you control worksheet recalculation deliberately. In the Maximum Value box. or slider. One is used as the Input Range for the control. Set the amount of change for each click to the spinner in the Incremental Change box. In the Minimum Value box. the user clicks the top or bottom arrow for incremental change or the grey part of the bar for a “page” amount of change. select the “Control” tab. Select the Cell Link box and click the cell in the worksheet that you want to receive the spinner result. 3.

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 E2 F2 G2

=VLOOKUP(C2,EmpData,2,FALSE) =VLOOKUP(C2,EmpData,3,FALSE) =VLOOKUP(C2,EmpData,4,FALSE) =VLOOKUP(C2,EmpData,5,FALSE)

Lookup formulas in row 2 look up the information for the employee name in cell C2.

Functions Relevant to Lookups Several Excel functions are useful when writing formulas to look up information in a table. Table 15.1 lists and describes these functions.

68

Financial Modelling in Excel (v2007) Basic Lookup Formulas

© Celsoft Corporation

You can use the Excel basic lookup functions to search a column or row for a lookup value to return another value as a result. Excel provides three basic lookup functions: HLOOKUP, VLOOKUP, and LOOKUP. In addition, the MATCH and INDEX functions are often used together to return a cell or relative cell reference for a lookup value. The VLOOKUP function The VLOOKUP function looks up the value in the first column of the lookup table and returns the corresponding value in a specified table column. The lookup table is arranged vertically (which explains the V in the function’s name). The syntax for the VLOOKUP function is VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) The VLOOKUP function’s arguments are as follows:

look up_value : The value to be looked up in the first column of the lookup table. table_array : The range that contains the lookup table. col_index _num : The column 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 that is 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.

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. The HLOOKUP function The HLOOKUP function works just like the VLOOKUP function except that the lookup table is arranged horizontally instead of vertically. The HLOOKUP function looks up the value in the first row of the lookup table and returns the corresponding value in a specified table row. The syntax for the HLOOKUP function is HLOOKUP(lookup_value,table_array,row_index_num,range_lookup) The HLOOKUP function’s arguments are as follows

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.

The formula in cell B3 is =HLOOKUP(B2,E1:J3,3) The LOOKUP function The LOOKUP function has the following syntax: LOOKUP(lookup_value,lookup_vector,result_vector) The function’s arguments are as follows:

look up_value : The value to be looked up in the lookup_vector. look up_vector : A single-column or single-row range that contains the values to be looked up.

These values must be in ascending order.

70

available only in Excel 2007. Specialized Lookup Formulas Looking up an exact value As demonstrated in the previous examples. you would probably require a perfect match for the number. For example. A summing formula returns the sum of the values of the cells in a range that meet certain criteria. when looking up an employee number. An example is looking up a tax rate in a tax table. In some cases. 71 . a counting formula returns the number of cells in a specified range that meet certain criteria. Selected Excel’s Counting and Summing Functions Function COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS* SUM SUMIF SUMIFS* Description Returns the number of cells that contain a numeric value Returns the number of nonblank cells Returns the number of blank cells Returns the number of cells that meet a specified criterion Returns the number of cells that meet multiple criteria Returns the sum of its arguments Returns the sum of cells that meet a specified criterion Returns the sum of cells that meet multiple criteria * These are new functions. 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). LOOKUP returns #N/A. VLOOKUP and HLOOKUP don’t necessarily require an exact match between the value to be looked up and the values in the lookup table.Financial Modelling in Excel (v2007) © Celsoft Corporation result_vector : The single-column or single-row range that contains the values to be returned. CAUTION: Values in the lookup_vector must be in ascending order. Counting and Summing Worksheet Cells Generally. If lookup_value is smaller than the smallest value in lookup_vector. It must be the same size as the lookup_vector. you may require a perfect match.

It simply multiplies the number of rows (returned by the ROWS function) by the number of columns (returned by the COLUMNS function). 72 . 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.Financial Modelling in Excel (v2007) Counting the total number of cells © Celsoft Corporation To get a count of the total number of cells in a range (empty and non-empty cells). use the following formula. text.””. For example. If the cell meets this condition. For example. the COUNTBLANK function counts that cell. The following formula uses the COUNTA function to return the number of nonblank cells in a range named Data: =COUNTA(Data) The COUNTA function counts cells that contain values. =COUNTBLANK(Sheet1!1:1048576) Counting nonblank cells To count nonblank cells. =ROWS(Data)*COLUMNS(Data) Counting blank cells The following formula returns the number of blank (empty) cells in a range named Data: =COUNTBLANK(Data) The COUNTBLANK function also counts cells containing a formula that returns an empty string. or it will create a circular reference. use the COUNTA function.A1) You can use the COUNTBLANK function with an argument that consists of entire rows or columns. This formula returns the number of cells in a range named Data. =IF(A1>5. You must enter this formula on a sheet other than Sheet1. or logical values (TRUE or FALSE). the formula that follows returns an empty string if the value in cell A1 is greater than 5.

”<>0”) =COUNTIF(Data.Financial Modelling in Excel (v2007) © Celsoft Corporation NOTE: If a cell contains a formula that returns an empty string.12) =COUNTIF(Data. The COUNTIF function takes two arguments: • • 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 Examples of Formulas Using the COUNTIF Function =COUNTIF(Data. Advanced Counting Formulas Most of the basic examples presented above use functions or formulas that perform conditional counting. Counting cells by using the COUNTIF function Excel’s COUNTIF function is useful for single-criterion counting formulas.”>5”) =COUNTIF(Data. even though the cell appears to be blank. based on various types of criteria. Cells that contain a logical value (TRUE or FALSE) aren’t considered to be numeric cells.A1) =COUNTIF(Data. use the following formula (which assumes the range is named Data): =COUNT(Data) Cells that contain a date or a time are considered to be numeric cells. Counting numeric cells To count only the numeric cells in a range. that cell is included in the count returned by COUNTA.”<0”) =COUNTIF(Data. The advanced counting formulas that we present here represent more complex examples for counting worksheet cells.”>”&A1) Returns the number of cells containing the value 12 Returns the number of cells containing a negative value Returns the number of cells not equal to 0 Returns the number of cells greater than 5 Returns the number of cells equal to the contents of cell A1 Returns the number of cells greater than the value in 73 .

TODAY()) =COUNTIF(Data.”*budget*”) =COUNTIF(Data.Financial Modelling in Excel (v2007) cell A1 =COUNTIF(Data. Counting the most frequently occurring entry The MODE function returns the most frequently occurring value in a range.”budget”) =COUNTIF(Data.”A*”) =COUNTIF(Data. the second member of the pair is the criterion. For example.”>”&AVERAGE(Data)) =COUNTIF(Data.”#N/A”) © Celsoft Corporation Returns the number of cells containing text Returns the number of text cells containing exactly three characters Returns the number of cells containing the single word budget (not case sensitive) Returns the number of cells containing the text budget anywhere within the text Returns the number of cells containing text that begins with the letter A (not case sensitive): Returns the number of cells containing the current date Returns the number of cells with a value greater than the average Returns the number of cells containing the value 3 or –3 Returns the number of cells containing logical TRUE Returns the number of cells containing the #N/A error value Counting cells by using multiple criteria In many cases. your counting formula will need to count cells only if two or more criteria are met.-3) =COUNTIF(Data.3)+COUNTIF(Data. =MODE(Data) 74 .”<=200”) The first member of the pair is the range to be counted (in this case.TRUE) =COUNTIF(Data. For this example. you may want to count cells that contain a value greater than 100 and less than or equal to 200.”*”) =COUNTIF(Data.”???”) =COUNTIF(Data.”>100”. the new COUNTIFS function will do the job: =COUNTIFS(Amount.Amount. the range named Amount).

returns the sum of all values in column A.G1:G9. for example.MODE(Data)) Summing Formulas The examples in this section demonstrate how to perform common summing tasks by using formulas.E1:E9.Financial Modelling in Excel (v2007) The MODE function returns the most frequently occurring value in a range.C1:C9. The formulas range from very simple to relatively complex array formulas that compute sums by using multiple criteria. returns the sum of the values in five noncontiguous ranges: =SUM(A1:A9. use the following formula: =COUNTIF(Data. © Celsoft Corporation To count the number of times the most frequently occurring value appears in the range (in other words. 75 . The following formula returns the sum of all values in a range named Data: =SUM(Data) The SUM function can take up to 255 arguments. The formula that follows. The following formula.I1:I9) You can use complete rows or columns as an argument for the SUM function. the frequency of the mode). Summing all cells in a range It doesn’t get much simpler than this. for example.

If you omit this argument.Financial Modelling in Excel (v2007) =SUM(A:A) Computing a cumulative sum © Celsoft Corporation You may want to display a cumulative sum of values in a range—sometimes known as a “running total. For this worksheet. you can create a formula. For example. This section presents examples of conditional summing by using a single criterion. 76 . such as the following. the function uses the range specified in the first argument. Summing only negative values The following formula returns the sum of the negative values in column F. which gets the criteria argument from the contents of cell G2: =SUMIF(Difference. values in a range that meet one or more conditions are included in the sum. the formula returns –63. The SUMIF function is very useful for single-criterion sum formulas. you need to calculate a conditional sum. With a conditional sum. 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. sum _range : Optional.G2) This formula returns a new result if you change the criteria in cell G2. In other words. The range that contains the cells you want to sum. 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(B$2:B2) Conditional Sums Using a Single Criterion Often. it returns the total number of past-due days for all invoices. =SUMIF(Difference.”<0”) Because you omit the third argument.

=SUMIFS(Amount. Determining whether a cell contains text In some situations.Financial Modelling in Excel (v2007) © Celsoft Corporation Summing values based on a different range The following formula returns the sum of the past-due invoice amounts (in column C): =SUMIF(Difference. You can access these functions just where you’d expect: from the Text control in the Function Library group of the Formula tab. you may use an IF function to return a result only if a cell contains text.Difference. 77 .”<0”.”Oregon”) Text Functions Text Functions Excel has an excellent assortment of worksheet functions that can handle text. The easiest way to make this determination is to use the ISTEXT function.Amount) This formula uses the values in the Difference range to determine if the corresponding values in the Amount range contribute to the sum. you may need a formula that determines the type of data contained in a particular cell.Office. For example. The examples in this section involve summing cells based on multiple criteria. Summing values based on a text comparison The following formula returns the total invoice amounts for the Oregon office: =SUMIF(Office.Amount) Conditional Sums Using Multiple Criteria The examples in the preceding section all used a single comparison criterion.”=Oregon”.”<0”.

These functions are quite straightforward.C1. for example.D1) Changing the case of text Excel provides three handy functions to change the case of text: UPPER converts the text to ALL UPPERCASE. which takes up to 255 arguments. 78 . if cell A1 contains the text Tucson and cell A2 contains the text Arizona. The formula that follows returns TRUE if A1 contains a string: =ISTEXT(A1) Joining two or more cells Excel uses an ampersand (&) as its concatenation operator. LOWER converts the text to all lowercase. the following formula will return TucsonArizona: =A1&A2 NOTE: Excel also has a CONCATENATE function. PROPER converts the text to Proper Case (the first letter in each word is capitalized. =PROPER(A1) Time and Date Functions Date-Related Functions Excel has quite a few functions that work with dates. The formula that follows.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. For example. These functions are accessible by choosing Formulas ➪ Function Library ➪ Date & Time. For example: =CONCATENATE(A1. Concatenation is simply a fancy term that describes what happens when you join the contents of two or more cells.B1. as in a proper name). converts the text in cell A1 to proper case.

the formulas display the current date. you may have a financial worksheet that calculates interest earned on a deposit account. Selected Date-Related Functions Function MONTH NETWORKDAYS* NOW TODAY WEEKNUM* YEAR Description Converts a serial number to a month Returns the number of whole work days between two dates Returns the serial number of the current date and time Returns the serial number of today’s date Returns the week number in the year Converts a serial number to a year © Celsoft Corporation Displaying the current date The following function displays the current date in a cell: =TODAY() You can also display the date combined with text. Calculating the number of days between two dates A common type of date calculation determines the number of days between two dates. =EndDay-StartDay+1 Calculating the number of work days between two dates 79 . If your sheet contains the open date and the close date for the account. yyyy”) It’s important to understand that the TODAY function is updated whenever the worksheet is calculated. displays text. for example. The formula that follows.Financial Modelling in Excel (v2007) The Table below summarizes the date-related functions available in Excel. mmmm d. The interest earned depends on the number of days the account is open. For example. you can calculate the number of days the account was open. if you enter either of the preceding formulas into a worksheet. But when you open the workbook tomorrow. such as =”Today is “&TEXT(TODAY(). they will display the current date (not the date when you entered the formula). For example.”dddd.

so you must provide this information in a range. Calculating the number of years between two dates The following formula calculates the number of years between two dates. As an option. If cell B1 contains a more recent date than the date in cell A1. For example. The range A2:A11 contains a list of holiday dates. The function is now part of Excel 2007. Excel has absolutely no way of determining which days are holidays. 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 .B15. one Saturday. NEW FEATURE: In versions prior to Excel 2007. This calculation should exclude Saturdays. the result will be negative. which means that the seven-day period beginning with January 1 contains four work days. Sundays. and one Sunday. For example. you can specify a range of cells that contain the dates of holidays. the formula in cell C15 is =NETWORKDAYS(A15. and holidays. In other words. This formula assumes that cells A1 and B1 both contain dates: =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. excluding weekend days (Saturdays and Sundays). the calculation excludes one holiday. you may need to know how many business days fall in the month of November.A2:A11) This formula returns 4. The formula in cell C16 calculates the total number of work days in the year. The two formulas in column C calculate the work days between the dates in column A and column B. the NETWORKDAYS function was available only when the Analysis ToolPak add-in was installed. The NETWORKDAYS function can help out.4 shows a worksheet that calculates the work days between two dates.Financial Modelling in Excel (v2007) © Celsoft Corporation When calculating the difference between two dates. which are also excluded. Figure 13. The NETWORKDAYS function calculates the difference between two dates. you may want to exclude weekends and holidays.

After you create a pivot table. unlike a formula-based summary report. In addition. because a single click of the Refresh button forces a pivot table to update itself with the latest data. The quickest way is to choose Home ➪ Number ➪ Format Number and select Time from the drop-down list. And the icing on the cake: With a few mouse clicks. ANALYSING DATA Pivot Tables A pivot table is essentially a dynamic summary report generated from a database. You even can create post hoc groupings of summary items (for example. Perhaps the most innovative aspect of a pivot table is its interactivity. This drawback doesn’t pose a serious problem. you can display subtotals and any level of detail that you want. Start with the table below which shows a portion of the data used in creating the pivot table in this chapter. you can apply formatting to a pivot table to convert it into an attractive report. 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. combine Northern Region totals with Western Region totals). a pivot table can create frequency distributions and crosstabulations of several different data dimensions. A pivot table example The best way to understand the concept of a pivot table is to see one. One minor drawback to using a pivot table is that. however.Financial Modelling in Excel (v2007) =NOW()-TODAY() © Celsoft Corporation You need to format the cell with a time format to view the result as a recognizable time. 81 . For example. you can rearrange the information in almost any way imaginable and even insert special formulas that perform new calculations. a pivot table does not update automatically when you change information in the source data.

however. and produces a nice-looking report. a pivot table is a much better choice. you need to summarize it. The table contains 712 rows. and each row represents a new account. This table consists of a month’s worth of new account information for a three-branch bank. Summarizing a database is essentially the process of answering questions about the data. spend time sorting the data and creating formulas to answer these questions. In addition. Often.Financial Modelling in Excel (v2007) FIG © Celsoft Corporation This table is used to create a pivot table. 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. Following are a few questions that may be of interest to the bank’s management: • • • • • • What is the daily total new deposit amount for each branch? How many accounts were opened at each branch. the data doesn’t reveal much. pivot tables are much less prone to error than creating formulas. 82 . Creating a pivot table takes only a few seconds. The table has the following columns: Analyzing Data with Excel The bank accounts database contains quite a bit of information. of course. doesn’t require a single formula. To make the data more useful. But in its current form.

The picture below shows another pivot table generated from the bank data. which took about five seconds to make. This change. the pivot table displays the data only for Existing customers. (The user can also select New or All from the drop-down control. In the figure. This particular summary represents one of dozens of summaries that you can produce from this data. FIGURE 34. and account types appear as row labels. This pivot table shows the amount of new deposits.Financial Modelling in Excel (v2007) © Celsoft Corporation The picture below shows a pivot table created from the bank data. is another example of the flexibility of a pivot table. branches appear as column labels. broken down by branch and account type. 83 . This pivot table uses a drop-down Report Filter for the Customer item (in row 1).2 A simple pivot table.) Notice the change in the orientation of the table? For this pivot table.

you usually want to summarize one or more of the data fields. columns. A single database table can have any number of data fields and category fields. Although Excel can generate a pivot table from any database. not all databases benefit. Data appropriate for a pivot table © Celsoft Corporation A pivot table requires that your data is in the form of a rectangular database. fields in a database table consist of two types: • • Data: Contains a value or data to be summarized. Generally speaking. Conversely. AcctType. the Date. the values in the category fields appear in the pivot table as rows. or filters. the Amount field is a data field.Financial Modelling in Excel (v2007) E 34. select any cell in that range and then choose Insert ➪ Tables ➪PivotTable. For the bank account data. Creating a Pivot Table Creating a pivot table is an interactive process. For the bank account example. Category: Describes the data.3 A pivot table that uses a report filter. which displays the dialog box shown below 84 . You can store the database in either a worksheet range (which can be a table or just a normal range) or an external database file. and Customer fields are category fields because they describe the data in the Amount field. If your data is in a worksheet range. OpenedBy. When you create a pivot table. It’s not at all uncommon to experiment with various layouts until you find one that you’re satisfied with. Branch.

34. Click OK.5 In the Create PivotTable dialog box. as shown below 85 . including the worksheet that contains the data. If you’re creating a pivot table from an external data source. and Excel creates an empty pivot table and displays its PivotTable Field List. The default location is on a new worksheet.Financial Modelling in Excel (v2007) © Celsoft Corporation Excel attempts to guess the range. Use the bottom section of the Create PivotTable dialog box to indicate the location for your pivot table. you need to select that option and then click Choose Connection to specify the data source. but you can specify any range on any worksheet. you tell Excel where the data is and where you want the pivot table. based on the location of the active cell.

2. Excel can handle much more sophisticated models than the preceding example. Choose Insert ➪ Tables ➪ Pivot Table ➪ Pivot Chart. FIGURE 34. PERFORMING WHAT-IF ANALYSIS FIGURE 36. You can apply any of several built-in styles to a pivot table. Drag the AcctType field into the Row Labels area. FIGURE 34. Select any cell in the pivot table and choose PivotTable Tools ➪ Design ➪ PivotTable Styles to select a style. the pivot table displays the total of all the values in the Amount column.1 Types of What-If Analyses Not surprisingly.14 Creating Pivot Charts A pivot chart is a graphical representation of a data summary displayed in a pivot table. At this point. The pivot table shows the amount for each account type. Drag the Branch field into the Column Labels area. Right-click a field name and choose its location from the shortcut menu. you have three basic options: • Manual what-if analysis: Plug in new values and observe the effects on formula cells.7 Formatting the pivot table Notice that the pivot table uses General number formatting. Excel creates a pivot table and a pivot chart. 86 . cross-tabulated by branch. A pivot chart is always based on a pivot table. You can do so by using either of these techniques: • • Drag the field names to one of the four boxes in the PivotTable Field List. Drag the Amount field into the Values area.Financial Modelling in Excel (v2007) © Celsoft Corporation Laying out the pivot table Next. To perform a what-if analysis using Excel. you can’t create a pivot chart without a pivot table. Although Excel lets you create a pivot table and a pivot chart at the same time. set up the actual layout of the pivot table. select any value and choose PivotTable Tools ➪ Options ➪ Active Field ➪ Field Settings to display the Data Field Settings dialog box. To change the number format used. 3. Click the Number Format button and change the number format. 1. Now the pivot table shows the total amount for each of the account types.

Creating a one-input data table A one-input data table displays the results of one or more formulas for various values of a single input cell. In particular. but you should be aware of some other techniques. You can create a data table fairly easily. In fact. and people often use this technique without even realizing that they’re doing a type of what-if analysis. A data table is a dynamic range that summarizes formula cells for varying input cells. Manual What-If Analysis This method doesn’t require too much explanation. but data tables have some limitations. 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. Manual what-if analysis is very common.2 87 . Scenario Manager: Create named scenarios and generate reports that use outlines or pivot tables. Data Tables This section discusses one of Excel’s most underutilized features: data tables. a data table can deal with only one or two input cells at a time. You may want to print the results or save each scenario to a new workbook.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. the example that opens this chapter demonstrates how it’s done. This method of performing what-if analysis certainly has nothing wrong with it. You change the value in the input cells and see what happens to the formula cells. FIGURE 36. This limitation becomes clear as you view the examples. The term scenario refers to a specific set of values in one or more input cells.

monthly payment. © Celsoft Corporation You can place the data table anywhere in a worksheet. The upper-left cell of the table remains empty. E3:I12) and then choose Data ➪ Data Tools ➪ What-If Analysis ➪ Data Table. Column E contains the values of the single input cell (interest rate) that Excel will use in the table. To create the table. The top row contains references to formulas located elsewhere in the worksheet. and cell G3 contains the formula =C11. The goal of this exercise is to create a data table that shows the values of the four formula cells (loan amount.) The screen above shows the setup for the data table area. total payments.Financial Modelling in Excel (v2007) How a one-input data table is set up. You can use a single formula reference or any number of formula references. Excel calculates the values that result from each value of the input cell and places them under each formula reference. in 0. cell F3 contains the formula =C10. shown below. This example uses the mortgage loan worksheet from earlier in the chapter (see “A What-If Example”). (The file is named mortgage loan data table.xlsx. The left column contains various values for the single input cell. and total interest) for various interest rates ranging from 6 to 8 percent. For example.25-percent increments. 88 . Row 3 consists of references to the formulas in the worksheet. Excel displays the Data Table dialog box. select the data table range (in this case.

Financial Modelling in Excel (v2007) © Celsoft Corporation FIGURE 36. You can see the setup for this type of table below. a two-input data table lets you vary two input cells. Leave the Row Input Cell field blank. The result of the one-input data table. you must specify the worksheet cell that contains the input value.4 In the Data Table dialog box. you place this cell reference in the text box labeled Column Input Cell. and Excel fills in the table with the calculated results (see below). Creating a two-input data table As the name implies. Because variables for the input cell appear in the left column in the data table. 89 . Enter C7 or point to the cell in the worksheet. Click OK.

Financial Modelling in Excel (v2007) © Celsoft Corporation Although it looks similar to a one-input table. Enter the number mailed values in E5:E14.6URE 36. The upper-left cell of the table contains a reference to the single result formula. Select the range E4:M14 and choose Data ➪ Data Tools ➪ What-If Analysis ➪ Data Table. With a one-input table. 2. In a two-input table. 3. or references to formulas. Click OK. across the top row of the table.7 To create the data table: 1. 90 . Enter the response rate values in F4:M4. 5. and Excel fills in the data table. but they have a few limitations: • • You can vary only one or two input cells at a time. you can place any number of formulas. the two-input table has one critical difference: It can show the results of only one formula at a time. 4. Using Scenario Manager Data tables are useful. FIGURE 36. In the Data Table dialog box. this top row holds the values for the second input cell. specify B5 as the Row input cell (the response rate) and cell B4 as the Column input (the number mailed). The process of setting up a data table is not all that intuitive.

as shown below. named production model. These summary reports can be an outline or a pivot table. Excel substitutes the appropriate input values in your worksheet and recalculates the formulas. For example. You can then select a set of values by name. and Excel displays the worksheet by using those values. 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 also generate a summary report that shows the effect of various combinations of values on any number of result cells. you’re interested in a few select combinations. In many situations. you can define three scenarios: best case. this section starts with an example that uses a simplified production model.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). and most likely case. The company produces three products. Consequently. worst case. You then can switch to any of these scenarios by selecting the named scenario from a list.36 91 . Defining scenarios To introduce you to Scenario Manager.xlsx. and each product requires a different number of hours and a different amount of materials to produce. This workbook. your annual sales forecast may depend on several factors. This worksheet contains two input cells: the hourly labor cost (cell B2) and the unit cost for materials (cell B3). Excel’s Scenario Manager Feature makes automating your what-if models easy. not an entire table that shows all possible combinations of two input cells.

The managers need to be prepared for the worst case. Most Likely Case. they appear in the Scenarios list in this dialog box. Management is trying to predict the total profit. shown below. listed in Table 36. Choose Data ➪ Data Tools ➪ What-If Analysis ➪ Scenario Manger to display the Scenario Manager Dialog box. but is uncertain what the hourly labor cost and material costs will be. This dialog box consists of four parts: • Scenario Name: The name for the scenario. however. it tells you that no scenarios are defined—which is not too surprising because you’re just starting. The third scenario. The Worst Case scenario has high values for both the hourly cost and the materials cost. When you first open this dialog box.1. click the Add button in the Scenario Manager Dialog box. Excel displays its Add Scenario dialog box. has intermediate values for both of these input cells. You can give it any name that you like— preferably something meaningful. To add a scenario. They’ve identified three scenarios. and they’re interested in what would happen under the Best Case scenario.1 Scenario Best Case Worst Case Most Likely Hourly Cost 30 38 34 Materials Cost 57 62 59 The Best Case scenario has the lowest hourly cost and lowest materials cost.Financial Modelling in Excel (v2007) © Celsoft Corporation Formulas calculate the total profit per product (row 13) and the total combined profit (cell B15). As you add named scenarios. 92 . TABLE 36.

You can enter the cell addresses directly or point to them. add new text to it. Each named scenario can use the same set of changing cells or different changing cells. may have its opinion of what the input cells should be. for example. Excel displays the name of the person who created the scenario and the date that it was created. a hidden scenario doesn’t appear in the Scenario Manager Dialog box. Excel makes it easy to merge these various scenarios into a single workbook by using the Merge button in the Scenario Manager Dialog box. You can change this text. or delete it. Protecting a scenario prevents anyone from modifying it. and several people may have defined various scenarios. the finance department may have another opinion. Make your changes and click OK to return to the Scenario Manager Dialog box. • • Comment: By default. In the Edit Scenario dialog box. The marketing department. Displaying scenarios After you define all the scenarios and return to the Scenario Manager Dialog box. you may have several people working on a spreadsheet model. select the scenario that you want to change and click the Edit button.Financial Modelling in Excel (v2007) • © Celsoft Corporation Changing Cells: The input cells for the scenario. and your CEO may have yet another opinion. 93 . If you’ve created a name for the cells. From the Scenarios list. Notice that Excel automatically updates the Comments box with new text that indicates when the scenario was modified. click OK to access the Scenario Values dialog box. Clicking this button displays the Merge Scenarios dialog box. the dialog box displays the names of your defined scenarios. Select one of the scenarios and then click the Show button. 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. type the name. Merging scenarios In workgroup situations. The number of changing cells for a scenario is limited to 32. 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. press Ctrl while you click the cells). Non-adjacent cells are allowed (if pointing to multiple cells. Excel inserts the corresponding values into the changing cells and calculates the worksheet to show the results for that scenario.

Generating a scenario report If you’ve created multiple scenarios. Then. 2. Using the Scenarios Drop-Down List Excel has a Scenarios control. choose the sheet that contains the scenarios you want to merge from the Sheet list box. Excel displays the Scenario Summary dialog box.Financial Modelling in Excel (v2007) © Celsoft Corporation Before you merge scenarios. 5. In the Choose Commands From drop-down list. Excel displays the Customization tab of the Excel Options dialog box. 3. select Commands not In the Ribbon. and you return to the previous dialog box. Then. Oddly. But. if you use Scenario Manager. (Notice that the dialog box displays the number of scenarios in each sheet as you scroll through the Sheet list box. Scroll down the list and select Scenario. Using the Scenarios control is more efficient than bringing up the Scenario Manager Dialog box to view a different scenario. 4. which now displays the scenario names that you merged from the other workbook. 94 .) Click OK. make sure that the workbook from which you’re merging is open. Right-click your QAT and choose Customize Quick Access Toolbar. Click OK to close the Excel Options dialog box. click the Merge button in the Scenario Manager Dialog box. Choose the workbook that contains the scenarios you’re merging in the Book drop-down list. this useful tool doesn’t appear in the Ribbon. which is a drop-down list that shows all the defined scenarios and enables you to quickly display a scenario. When you click the Summary button in the Scenario Manager Dialog box. Scenario PivotTable: The summary report appears in the form of a pivot table. Excel displays its Merge Scenarios dialog box. using the following procedure: 1. you may want to add the Scenarios control to your Quick Access Toolbar (QAT). Click the Add button. You have a choice of report types: • • Scenario Summary: The summary report appears in the form of a worksheet outline. you may want to document your work by creating a scenario summary report.

Solver: Determines the values that you need to enter in multiple input cells to produce a result that you want. A goal-seeking example The diagram above shows the mortgage loan worksheet used in the preceding chapter. The following example shows you how single-cell goal seeking works. Originally. This example demonstrates the opposite 95 . select B13:D13 and B15 (a multiple selection) to make the report show the profit for each product. Excel determines what value in an input cell produces a desired result in a formula cell. This worksheet has four input cells (C4:C7) and four formula cells (C10:C13). Single-Cell Goal Seeking Single-cell goal seeking is a rather simple concept. because you can specify certain constraints to the problem. this worksheet was used for a what-if analysis example. 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. For this example. you gain significant problem-solving ability. Moreover.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).

You want to set cell C11 to 1800 by changing cell C4. Excel can usually determine the answer much more efficiently.50 percent. Excel displays the Goal Seek dialog box. a 20-percent down payment).1 This worksheet is a good demonstration of goal seeking. the annual interest rate Next.5% in cell C7.800? In this simple example. FIGURE 37. what value in cell C4 causes the formula in cell C11 to result in $1.Financial Modelling in Excel (v2007) © Celsoft Corporation approach. With more complex models. shown below. Completing this dialog box is similar to forming a sentence. you could plug values into cell C4 until C11 displays $1. this example lets Excel determine one of the input values that will produce the desired result. Rather than supply different input cell values to look at the calculated formulas. You also know that a lender can issue a 30-year fixed-rate mortgage loan for 6. The question is “What is the maximum purchase price I can handle?” In other words. based on an 80-percent loan-to-value (that is.800 monthly mortgage payment. Click OK to begin the goalseeking process. To answer the question posed in the preceding paragraph. FIGURE 3 96 . first set up the input cells to match what you already know. Assume that you’re in the market for a new home and you know that you can afford a $1. Specifically: Enter 20% in cell C5 (the down payment percent) Enter 360 in cell C6 (the loan term. Enter this information in the dialog box either by typing the cell references or by pointing with the mouse. choose Data ➪ Data Tools ➪ What-If Analysis ➪ Goal Seek.800. in months) Enter 6.

However. using Solver can be much more complicated. but it clearly has limitations.779). 97 . many users find that having this much power is worth spending the extra time to learn about it. you have two options: • • Click OK to replace the original value with the found value. 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.800. Appropriate problems for Solver • Problems that is appropriate for Solver fall into a relatively narrow range. Solver is probably one of the most difficult (and potentially frustrating) features in Excel. Click Cancel to restore your worksheet to the form that it had before you chose the Goal Seek command. They typically involve situations that meet the following criteria: • • • A target cell depends on other cells and formulas. The worksheet now displays the found value in cell C4 ($284. In fact. It can solve for only one adjustable cell. the monthly payment amount is $1.Financial Modelling in Excel (v2007) © Celsoft Corporation In less than a second. In this case. In fact. Introducing Solver The Excel Goal-Seek feature is a useful tool. most Excel users have no use for this feature. Excel displays the Goal Seek Status box. The solution must adhere to certain limitations. you want to maximize or minimize this target cell or set it equal to some value. As a result of this value. I’m the first to admit that Solver isn’t for everyone. Typically. or constraints. and it returns only a single solution. which shows the target value and the value that Excel calculated. At this point. Excel found an exact value. The target cell depends on a group of cells (called changing cells) that Solver can adjust to affect the target cell.

and Column D contains formulas that calculate the total profit for each product by multiplying the units by the profit per unit.Financial Modelling in Excel (v2007) © Celsoft Corporation After you set up your worksheet appropriately. You access Solver by choosing Data ➪ Analysis ➪ Solver. the logical solution is to produce only Product C. Therefore. select Excel Add-Ins from the Manage drop-down list and click Go. click the Add-Ins tab. 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. place a check mark next to Solver Add-In and click OK. 2. Choose File ➪ Excel Options. you wouldn’t need tools such as Solver. Column B shows the number of units of each product. Column C shows the profit per unit for each product. If this command isn’t available. Excel displays its Add-Ins dialog box. this company has some constraints that must be met: 98 . Use Solver to determine the number of units to maximize the total profit. The figure below shows a worksheet that is set up to calculate the profit for three products. you need to install the Solver add-in. In the Add-Ins dialog box. If things were really this simple. in order to maximize total profit. It’s a simple process: 1. As in most situations. A simple Solver example I start with a simple example to introduce Solver and then present some increasingly complex examples to demonstrate what this feature can do. At the bottom of the dialog box. In the Excel Options dialog box. 3. You don’t need an MBA degree to realize that the greatest profit comes from Product C. 4.

3. Because the market for Product C is relatively limited. Set up the worksheet with values and formulas.Financial Modelling in Excel (v2007) © Celsoft Corporation • • • • The combined production capacity is 300 total units per day. Specify the range that contains the changing cells. Specify the target cell. for example. Specify the constraints. Choose Data ➪ Analysis ➪ Solver to bring up the Solver dialog box. but here is the basic procedure for using Solver: 1. 6. Excel displays its Solver Parameters dialog box. 4. choose Data ➪ Analysis ➪ Solver. 2. the target cell is D6—the cell that calculates the total profit for three products. it’s a perfect problem for Solver. Change the Solver options. format those cells to contain numbers with no decimal values. 99 . In fact. These four constraints make the problem more realistic and a bit more challenging. The company needs 50 units of Product A to fill an existing order. To start Solver to tackle this example. if necessary. In this example. the company doesn’t want to produce more than 40 units of this product. 7. if you can’t produce partial units of your products. Make sure that you format cells logically. The company needs 40 units of Product B to fill an anticipated order. 5. I go into more detail in a moment. Let Solver solve the problem. shown below. The Solver Parameters dialog box.

The next step is to specify the constraints on the problem. and enter 300 as the Constraint value. specify the changing cells (which are in the range B3:B5) in the By Changing Cells box. To add a constraint.1 Constraints Summary Constraint Capacity is 300 units At least 50 units of Product At least 40 units of Product B No more than 40 units of Product C Expressed As B6=300 A B3>=50 B4>=40 B5<=40 7. which now lists the four constraints. click OK to return to the Solver Parameters dialog box. This dialog box has three parts: a Cell Reference. click the Max option. The constraints are added one at a time and appear in the box labeled Subject To the Constraints. and a Constraint value. 100 . FIGURE 37ABLE 37. an operator. To set the first constraint (that the total production capacity is 300 units). Because the objective is to maximize this cell.Financial Modelling in Excel (v2007) © Celsoft Corporation 1. 2. click the Add button. After you enter the last constraint. Next. Excel displays the Add Constraint dialog box. shown below. choose equal (=) from the drop-down list of operators. Solver knows everything about the problem. Click Add to add the remaining constraints. At this point. Enter (or point to) cell D6 in the Set Target Cell field of the Solver Parameters dialog box. 3. The diagram below summarizes the constraints for this problem. enter B6 as the Cell Reference. 4. 5. 6.

Financial Modelling in Excel (v2007) © Celsoft Corporation 8. with an appropriate name. which means that these constraints were satisfied at their limit with no more room to change. and Excel soon announces that it has found a solution. so that Scenario Manager can use it. Restore the original changing cell values. If you specify any report options. The Solver Results dialog box is shown below At this point. You can watch the progress onscreen. Click the Save Scenario button to save the solution as a scenario. you have the following options: • • • • Replace the original changing cell values with the values that Solver found. Excel creates each report on a new worksheet. two of the constraints are binding. In the Constraints section of the report. 101 . Create any or all three reports that describe what Solver did. Click the Solve button to start the solution process. The figure below shows an Answer Report.

these worksheet functions are built into Excel and no longer require the Analysis ToolPak add-in. the Analysis ToolPak add-in included many additional worksheet functions. engineering.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 Excel 2007. The Analysis ToolPak covers each of the following tools: • • • • • • • Analysis of variance (three types) Correlation Covariance Descriptive statistics Exponential smoothing F-Test Fourier analysis 102 . In previous versions of Excel. These analysis tools offer many features that may be useful to those in the scientific. and educational communities—not to mention business users whose needs extend beyond the normal spreadsheet fare.

can be attached to: • • • A button drawn on a worksheet Any picture or object on the worksheet In an icon on the toolbar. Select “Popular” 4. Macros can be written in Excel 4 macro language or in Visual Basic. To see this sheet hit Alt F11. Select “Excel Options” shown at the bottom of the dialogue box 3. A macro sheet can be set up by right-clicking the mouse whilst pointing at a sheet tab. macros are placed on a Visual Basic sheet. In the case of macros written in Visual Basic. Do this by: 1. and are stored: In the case of macros written in Excel 4 language. but this sheet does not appear as a sheet in the workbook. Note: Ex cel m acros can only be recorded in Visual Basic Macros once written.Financial Modelling in Excel (v2007) • Histogram © Celsoft Corporation RECORDING A MACRO A macro is a recorded (or typed) sequence of commands that can be used repeatedly. Click on the Office tool 2. Click the checkbox for “Show Developer tab in the Ribbon” Alternatively – command path – (Developer/ Record Macro) Excel 2003 – ( Tools/Macros) 103 . on a Macro sheet. Before recording macros it will be convenient to get the Developer tab displayed on the ribbon. 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.

but if stored in a Personal Macro Workbook. (Normally in this workbook. it will be available for all spreadsheet files) 104 . 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. and type a single letter to use as a shortcut key in the “Shortcut Key” box. Choose Developer/Code/Record Macro OR View/Macros/Record Macro (2003 – Tools/Macro/Record a new macro) The following dialogue box appears: 2.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. Avoid shortcut letters that are already used by Excel (such as ctrl c for Copy) 3. Replace the name Macro1 with a name of your choice. Pressing Ctrl and this shortcut letter will cause the macro to run once complete. Decide where you would like to store this macro. 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) Steps in recording a macro: 1.

Click OK. Carry out the commands you wish to record 6.Financial Modelling in Excel (v2007) © Celsoft Corporation 4. Two ways of running a macro: 1. Choose Developer/Code/Macros and click the Run button or 2 Hit the Ctrl key and the shortcut letter you assigned to the macro 105 . To view your macro hit Alt F8 (or Developer/Code/Macros). The macro now shown can be edited if desired. A Stop button appears. When you have finished choose Developer/Code/Stop Recording 7. 8. and the word Recording appears at the bottom of the screen. and click the Edit button. 5.