One of the most appealing aspects of Excel is its ability to create dynamic models. A dynamic model uses formulas that instantly recalculate when you change values in cells that are used by the formulas. When you change values in cells in a systematic manner and observe the effects on specific formula cells, you're performing a type of what-if analysis.
What-if analysis is the process of asking such questions as “What happens if the interest rate on the loan changes to 7.5 percent?” and “What occurs if we raise our product prices by 5 percent?”
If you set up your worksheet properly, answering such questions is simply a matter of plugging in new values and observing the results of the recalculation. Excel provides useful tools to assist you in your what-if endeavors.
Figure 31.1 shows a simple worksheet model that calculates information pertaining to a mortgage loan. The worksheet is divided into two sections: the input cells and the result cells (which contain formulas).
This workbook is available on this book's website at |
With this worksheet, you can easily answer the following what-if questions:
You can answer these questions by simply changing the values in the cells in range C4:C7 and observing the effects in the dependent cells (C10:C13). You can, of course, vary any number of input cells simultaneously.
Not surprisingly, Excel can handle much more sophisticated models than the preceding example. To perform a what-if analysis using Excel, you have three basic options:
We discuss each of these types of what-if analysis in the rest of this chapter.
A manual what-if analysis doesn't require too much explanation. In fact, the example that opens this chapter demonstrates how it's done. Manual what-if analysis is based on the idea that you have one or more input cells that affect one or more key formula cells. You change the value in the input cells and observe the formula calculations. You may want to print the results or save each scenario to a new workbook. The term scenario refers to a specific set of values in one or more input cells.
Manual what-if analysis is common. People often use this technique without even realizing that they're doing a what-if analysis. This method of performing what-if analysis certainly has nothing wrong with it, but you should be aware of some other techniques.
If your input cells are not located near the formula cells, consider using a Watch Window to monitor the formula results in a movable window. We discuss this feature in Chapter 3, “Performing Basic Worksheet Operations.” |
This section describes one of Excel's most underutilized features: data tables. A data table is a dynamic range that summarizes formula cells for varying input cells. You can create a data table fairly easily, but data tables have some limitations. In particular, a data table can deal with only one or two input cells at a time. This limitation becomes clear as you view the examples.
Don't confuse a data table with a standard table (created by choosing Insert ⇨ Tables ⇨ Table). These two features are completely independent.
A one-input data table displays the results of one or more formulas for various values of a single input cell. Figure 31.2 shows the general layout for a one-input data table. You need to set up the table manually yourself. This is not something that Excel will do for you.
You can place the data table anywhere in a worksheet. The left column contains various values for the single input cell. The top row contains references to formulas located elsewhere in the worksheet. You can use a single formula reference or any number of formula references. The upper-left cell of the table remains empty. Excel calculates the values that result from each value of the input cell and places them under each formula reference.
This example uses the mortgage loan worksheet from earlier in the chapter (see “Looking at a What-If Example”). The goal of this exercise is to create a data table that shows the values of the four formula cells (loan amount, monthly payment, total payments, and total interest) for various interest rates ranging from 4.5% to 6.5%, in 0.25% increments.
This workbook is available on this book's website at |
Figure 31.3 shows the setup for the data table area. Row 3 consists of references to the formulas in the worksheet. For example, cell F3 contains the formula =C10
, and cell G3 contains the formula =C11
. Row 2 and column D contain optional descriptive labels that are not actually part of the 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, select the entire data table range (in this case, E3:I12) and then choose Data ⇨ Forecast ⇨ What-If Analysis ⇨ Data Table. The Data Table dialog box, shown in Figure 31.4, appears.
You must specify the worksheet cell that contains the input value. Because variables for the input cell appear in the left column in the data table, you place this cell reference in the Column Input Cell field. Enter C7
or point to the cell in the worksheet. Leave the Row Input Cell field blank. Click OK, and Excel fills in the table with the calculated results (see Figure 31.5).
Using this table, you can now see the calculated loan values for varying interest rates. Notice that the Loan Amt column (column F) doesn't vary. That's because the formula in cell C10 doesn't depend on the interest rate.
If you examine the contents of the cells that Excel entered as a result of this command, you'll see that the data is generated with a multicell array formula:
{=TABLE(,C7)}
A multicell array formula is a single formula that can produce results in multiple cells (see Chapter 18, “Understanding and Using Array Formulas”). Because the table uses formulas, Excel updates the table that you produce if you change the cell references in the first row or plug in different interest rates in the first column.
As the name implies, a two-input data table lets you vary two input cells. You can see the setup for this type of table in Figure 31.6. Although it looks similar to a one-input table, the two-input table has one critical difference: it can show the results of only one formula at a time. With a one-input table, you can place any number of formulas, or references to formulas, across the top row of the table. In a two-input table, this top row holds the values for the second input cell. The upper-left cell of the table contains a reference to the single result formula.
Using the mortgage loan worksheet, you could create a two-input data table that shows the results of a formula (say, monthly payment) for various combinations of two input cells (such as interest rate and down-payment percent). To see the effects on other formulas, you simply create multiple data tables—one for each formula cell that you want to summarize.
The example in this section uses the worksheet shown in Figure 31.7 to demonstrate a two-input data table. In this example, a company wants to conduct a direct-mail promotion to sell its product. The worksheet calculates the net profit from the promotion.
This workbook, named |
This model uses two input cells: the number of promotional pieces mailed and the anticipated response rate. The following items appear in the Parameters area:
=IF(B4<200000,0.2,IF(B4<300000,0.15,0.1))
=B4*B5
=B10*B11
=B4*(B8+B9)
If you enter values for the two input cells, you see that the net profit varies quite a bit, often going negative to produce a net loss.
Figure 31.8 shows the setup of a two-input data table that summarizes the net profit at various combinations of quantity and response rate; the table appears in the range E4:M14. Cell E4 contains a formula that references the Net Profit cell:
=B14
To create the data table, follow these steps:
Figure 31.9 shows the result. As you can see, quite a few of the combinations of response rate and quantity mailed result in a loss rather than a profit.
As with the one-input data table, this data table is dynamic. You can change the formula in cell E4 to refer to another cell (such as gross profit), or you can enter some different values for Response Rate and Number Mailed.
Data tables are useful, but they have a few limitations:
The Scenario Manager is a fairly easy way to automate some aspects of your what-if models. You can store different sets of input values (called changing cells in the terminology of Scenario Manager) for any number of variables and give a name to each set. You can then select a set of values by name, and Excel displays the worksheet by using those values. You can also generate a summary report that shows the effect of various combinations of values on any number of result cells. These summary reports can be an outline or a PivotTable.
For example, your annual sales forecast may depend on several factors. Consequently, you can define three scenarios: best case, worst case, and most likely case. You then can switch to any of these scenarios by selecting the named scenario from a list. Excel substitutes the appropriate input values in your worksheet and recalculates the formulas.
To introduce you to Scenario Manager, this section starts with an example that uses a simplified production model, as shown in Figure 31.10.
This workbook, named |
This worksheet contains two input cells: the hourly labor cost (cell B2) and the unit cost for materials (cell B3). The company produces three products, and each product requires a different number of hours and a different amount of materials to produce.
Formulas calculate the total profit per product (row 13) and the total combined profit (cell B15). Management—trying to predict the total profit but uncertain what the hourly labor cost and material costs will be—has identified three scenarios, which are listed in Table 31.1.
TABLE 31.1 Three Scenarios for the Production Model
Scenario | Hourly Cost | Materials Cost |
Best Case | 30 | 57 |
Worst Case | 38 | 62 |
Most Likely | 34 | 59 |
The Best Case scenario has the lowest hourly cost and the lowest materials cost. The Worst Case scenario has high values for both the hourly cost and the materials cost. The third scenario, Most Likely, has intermediate values for both of these input cells. The managers need to be prepared for the worst case, however, and they're interested in what would happen under the Best Case scenario.
Choose Data ⇨ Forecast ⇨ What-If Analysis ⇨ Scenario Manager to display the Scenario Manager dialog box. When you first open this dialog box, it tells you that no scenarios are defined, which is not too surprising because you're just starting. As you add named scenarios, they appear in the Scenarios list in this dialog box.
To add a scenario, click the Add button in the Scenario Manager dialog box. Excel displays its Add Scenario dialog box, shown in Figure 31.11.
This dialog box consists of four parts:
In this example, define the three scenarios that are listed in Table 31.1. The changing cells are Hourly cost (B2) and Materials cost (B3).
After you enter the information in the Add Scenario dialog box, click OK. Excel then displays the Scenario Values dialog box, shown in Figure 31.12. This dialog box displays one field for each changing cell that you specified in the previous dialog box. Enter the values for each cell in the scenario. If you click OK, you return to the Scenario Manager dialog box, which then displays your named scenario in its list. If you have more scenarios to create, click the Add button to return to the Add Scenario dialog box.
After you define all the scenarios and return to the Scenario Manager dialog box, the dialog box displays the names of your defined scenarios. Select one of the scenarios and then click the Show button (or double-click the Scenario name). Excel inserts the corresponding values into the changing cells and calculates the worksheet to show the results for that scenario. Figure 31.13 shows an example of selecting a scenario.
After you've created scenarios, you may need to change them. To do so, follow these steps:
In workgroup situations, you may have several people working on a spreadsheet model, and several people may have defined various scenarios. The marketing department, for example, may have its opinion of what the input cells should be, the finance department may have another opinion, and your CEO may have yet another opinion.
Excel makes it easy to merge these various scenarios into a single workbook. Before you merge scenarios, make sure that the workbook from which you're merging is open:
If you've created multiple scenarios, you may want to document your work by creating a scenario summary report. When you click the Summary button in the Scenario Manager dialog box, Excel displays the Scenario Summary dialog box.
You have a choice of report types:
See Chapter 27, “Creating and Using Worksheet Outlines,” for more information about outlines, and see Chapter 29, “Introducing PivotTables,” for an introduction to PivotTables. |
For simple cases of scenario management, a standard Scenario Summary report is usually sufficient. If you have many scenarios defined with multiple result cells, however, you may find that a Scenario PivotTable provides more flexibility.
The Scenario Summary dialog box also asks you to specify the result cells (the cells that contain the formulas in which you're interested). For this example, select B13:D13 and B15 (a multiple selection) to make the report show the profit for each product plus the total profit.
Excel creates a new worksheet to store the summary table. Figure 31.14 shows the Scenario Summary form of the report. If you gave names to the changing cells and result cells, the table uses these names; otherwise, it lists the cell references.