Chapter 18. Performing What-If Analysis

Using Data Tables

Using the Scenario Manager

Using the Goal Seek Command

Using the Solver

“WHAT IF?” is one of the most important financial questions; spreadsheet software was literally created to answer that question, taking the tedium out of the complicated calculations necessary to do so. Instead of starting your calculations from the beginning every time your assumptions change, you can change just a few variables and instantly see the effect. Excel 2010 offers a number of advanced what-if features, which we discuss in this chapter.

image with no caption

A data table, or sensitivity table, summarizes the impact of one or two variables on formulas that use those variables. You can click the What-If Analysis button in the Data Tools group on the Data tab and then click Data Table to create two kinds of data tables: tables based on a single input variable that test the variable’s impact on more than one formula, and tables based on two input variables that test their impact on a single formula.

Note

Some of the most powerful tools Excel offers for performing what-If analysis are not covered in this chapter because they are awesome enough to have a chapter of their own. Take a look at Chapter 23 for a comprehensive look at PivotTables and the new PowerPivot feature. These tools give you superhuman powers over mass quantities of data, providing easy access to giant databases and allowing you to slice and dice the data any way you like.

Suppose you’re considering buying a house that requires you to take on a 30-year, $200,000 mortgage, and you need to calculate monthly payments on the loan for several interest rates. A one-variable data table, such as the one shown in Figure 18-1, can give you the information you need.

To create this table, type the interest rates you want to test, as shown in cells B3:B9 in Figure 18-1. This is the input range because it contains the input values you want to test. Type the loan amount in a cell outside the data table area. We typed $200,000 in cell C1. This allows us to easily change the loan amount to test various scenarios. Enter the formula that uses the input variable. In this case, type the formula =PMT(A2/12, 360, C1) in cell C2. In this formula, A2/12 is the monthly interest rate, 360 is the term of the loan in months, and C1 refers to the cell containing the loan principal.

After you enter the inputs and the formula, select the data table—the smallest rectangular block that includes the formula and all the values in the input range. In this case, select the range B2:C9. Click the What-If Analysis button in the Data Tools group on the Data tab, and then click Data Table.

In the Data Table dialog box, shown in Figure 18-2, specify the location of the input cell in the Row Input Cell or Column Input Cell box. The input cell is the placeholder cell referred to by the table formula—in this example, A2. If the input values are arranged in a row, type the input cell reference in the Row Input Cell box. If the values in the input range are arranged in a column, as in our example, use the Column Input Cell box.

After you click OK, Excel enters the results of the table formula (one result for each input value) in the available cells of the data table range. In this example, Excel enters six results in the range C3:C9, as shown in Figure 18-3, with a little formatting we added for easier reading.

When you create this data table, Excel enters the array formula { =TABLE(,A2)} in each cell in the results range C3:C9. In the sample data table, the formula computes the results of the PMT function by using each of the interest rates in column B. After you build the table, you can change the loan amount or any of the interest rate values to see the results immediately.

Suppose you want to build a data table that computes the monthly payment on a $200,000 mortgage, but this time you want to vary not only the interest rate but also the term of the loan. You want to know what effect changing the interest rate and the term have on your monthly payment.

To create this table, you can again type seven interest rates in cells B3:B9. Then type the second set of input values—the loan terms, in months—in a row above and to the right of the first set, as shown in Figure 18-5.

After you type the loan amount in a cell outside the table area (cell I2 in this example), you can create the table formula. Because this is a two-variable table, you must type the formula in the cell at the intersection of the row and column that contain the sets of input values—cell B2, in this example. Although you can include as many formulas as you want in a single-variable data table, you can include only one output formula in a two-variable table. The formula for the table in this example is =PMT(A2/12, B1, I2).

You’ll notice immediately that the formula in cell B2 returns an error value because of the two blank “placeholder” cells, A2 and B1. As you’ll see, this spurious result does not affect the performance of the table.

Finally, select the data table—the smallest rectangular block that includes all the input values and the table formula. In this example, the table range is B2:F9. Click the What-If Analysis button on the Data tab, then click Data Table, and finally specify the (empty) input cells. Because this is a two-variable table, you must define two input cells. For this example, type the reference for the first input cell, $B$1, in the Row Input Cell box, and then type the reference for the second input cell, $A$2, in the Column Input Cell box. Figure 18-6 shows the result.

TROUBLESHOOTING

The results in my two-input data table are wrong.

Be careful not to reverse the input cells in a two-variable table. If you do, Excel uses the input values in the wrong place in the table formula, which creates a set of meaningless results. For example, if you reverse the input cells in the example shown in Figure 18-6, Excel uses the values in the input range C2:F2 as interest rates and the values in the input range B3:B9 as terms, resulting in monthly payments in the $20 million range!

To be sure you’re using the correct input cells, look at the formula. In our example, =PMT(A2/12, B1, I2), A2 appears in the first argument, which is rate. Because the rates are arranged in a column, A2 is the column input cell.