Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

CHAPTER

Analyzing Data Using

Goal Seeking and

Solver

The preceding chapter discusses what-if analysis — the process of changing input cells to observe the results on other dependent cells. This chapter looks at that process from the opposite perspective:

finding the value of one or more input cells that produces a desired result in a formula cell.

This chapter covers two tools: Goal Seeking and the Solver add-in.

IN THIS CHAPTER

What-if analysis — in reverse

Single-cell goal seeking

Introducing Solver

Solver examples

Consider the following what-if question: “What is the total profit if sales increase by 20 percent?” If you set up your worksheet model properly, you can change the value in one cell to see what happens to the profit cell. The examples in this chapter take the opposite approach. If you know what a formula result should be, Excel can tell you the values that you need to enter in one or more input cells to produce that result. In other words, you can ask a question such as “How much do sales need to increase to produce a profit of $1.2 million?” Excel provides two tools that are relevant:

Goal Seek: Determines the value that you need to enter in a single input cell to produce a result that you want in a dependent (formula) cell.

Solver: Determines the values that you need to enter in multiple input cells to produce a result that you want. Moreover, because you can specify certain constraints to the problem, you gain significant problem-solving ability.

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Part V: Analyzing Data with Excel

Single-Cell Goal Seeking

Single-cell goal seeking is a rather simple concept. Excel determines what value in an input cell produces a desired result in a formula cell. The following example shows you how single-cell goal seeking works.

A goal-seeking example

Figure 37.1 shows the mortgage loan worksheet used in the preceding chapter. This worksheet has four input cells (C4:C7) and four formula cells (C10:C13). Originally, this worksheet was used for a what-if analysis example. This example demonstrates the opposite approach. Rather than supply different input cell values to look at the calculated formulas, this example lets Excel determine one of the input values that will produce the desired result.

On the CD

This workbook is available on the companion CD-ROM. The file is named mortgage loan.xlsx.

FIGURE 37.1

This worksheet is a good demonstration of goal seeking.

Assume that you’re in the market for a new home and you know that you can afford an $1,800 monthly mortgage payment. You also know that a lender can issue a 30-year fixed-rate mortgage loan for 6.50%, based on an 80% loan-to-value (that is, a 20% down payment). The question is “What is the maximum purchase price I can handle?” In other words, what value in cell C4 causes the formula in cell C11 to result in $1,800? In this simple example, you could plug values into cell C4 until C11 displays $1,800. With more complex models, Excel can usually determine the answer much more efficiently.

To answer the question posed in the preceding paragraph, first set up the input cells to match what you already know. Specifically:

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Chapter 37: Analyzing Data Using Goal Seeking and Solver

Enter 20% in cell C5 (the down payment percent)

Enter 360 in cell C6 (the loan term, in months)

Enter 6.5% in cell C7 (the annual interest rate)

Next, choose Data Data Tools What-If Analysis Goal Seek. Excel displays the Goal Seek dialog box, shown in Figure 37.2. Completing this dialog box is similar to forming a sentence. You want to set cell C11 to 1800 by changing cell C4. Enter this information in the dialog box either by typing the cell references or by pointing with the mouse. Click OK to begin the goal-seeking process.

FIGURE 37.2

The Goal Seek dialog box.

In less than a second, Excel displays the Goal Seek Status box, which shows the target value and the value that Excel calculated. In this case, Excel found an exact value. The worksheet now displays the found value in cell C4 ($355,974). As a result of this value, the monthly payment amount is $1,800. At this point, you have two options:

Click OK to replace the original value with the found value.

Click Cancel to restore your worksheet to the form that it had before you chose Goal Seek.

More about goal seeking

Excel can’t always find a value that produces the result that you’re seeking. Sometimes, a solution simply doesn’t exist. In such a case, the Goal Seek Status box informs you of that fact.

Other times, however, Excel may report that it can’t find a solution, but you’re pretty sure that one exists. If that’s the case, you can try the following options:

Change the current value of the By Changing Cell field in the Goal Seek dialog box (refer to Figure 37.2) to a value that is closer to the solution and then reissue the command.

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Part V: Analyzing Data with Excel

Adjust the Maximum iterations setting on the Formulas tab of the Excel Options dialog box (choose File Excel Options). Increasing the number of iterations (or calculations) makes Excel try more possible solutions.

Double-check your logic and make sure that the formula cell does, indeed, depend upon the specified changing cell.

Note

Like all computer programs, Excel has limited precision. To demonstrate this limitation, enter =A1^2 into cell

A2. Then, use the Goal Seek dialog box to find the value in cell A1 (which is empty) that makes the formula return 16. Excel comes up with a value of 4.00002269, which is close to the square root of 16, but certainly not exact. You can adjust the precision on the Formulas tab of the Excel Options dialog box (make the Maximum Change value smaller). n

Note

In some cases, multiple values of the input cell produce the same desired result. For example, the formula =A1^2 returns 16 if cell A1 contains either –4 or +4. If you use goal seeking when multiple solutions are possible, Excel gives you the solution that is closest to the current value. n

Introducing Solver

The Excel Goal Seek feature is a useful tool, but it clearly has limitations. It can solve for only one adjustable cell, and it returns only a single solution. Excel’s powerful Solver tool extends this concept by enabling you to do the following:

Specify multiple adjustable cells.

Specify constraints on the values that the adjustable cells can have.

Generate a solution that maximizes or minimizes a particular worksheet cell.

Generate multiple solutions to a problem.

Although goal seeking is a relatively simple operation, using Solver can be much more complicated. In fact, Solver is probably one of the most difficult (and potentially frustrating) features in Excel. I’m the first to admit that Solver isn’t for everyone. In fact, most Excel users have no use for this feature. However, many users find that having this much power is worth spending the extra time to learn about it.

New Feature

In Excel 2010, the Solver add-in received a much-needed facelift. In addition to the cosmetic improvements, the product also performs better. n

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Chapter 37: Analyzing Data Using Goal Seeking and Solver

No Solver Command?

You access Solver by choosing Data Analysis Solver. If this command isn’t available, you need to install the Solver add-in. It’s a simple process:

1.Choose File Options.

2.In the Excel Options dialog box, click the Add-Ins tab.

3.At the bottom of the dialog box, select Excel Add-Ins from the Manage drop-down list and then click Go. Excel displays its Add-Ins dialog box.

4.In the Add-Ins dialog box, place a check mark next to Solver Add-In and then click OK.

After performing these steps, the Solver add-in loads whenever you start Excel.

Appropriate problems for Solver

Problems that are appropriate for Solver fall into a relatively narrow range. They typically involve situations that meet the following criteria:

A target cell depends upon other cells and formulas. Typically, you want to maximize or minimize this target cell or set it equal to some value.

The target cell depends on a group of cells (called changing cells) that Solver can adjust to affect the target cell.

The solution must adhere to certain limitations, or constraints.

After you set up your worksheet appropriately, you can use Solver to adjust the changing cells and produce the result that you want in your target cell — and simultaneously meet all the constraints that you defined.

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.

Figure 37.3 shows a worksheet that is set up to calculate the profit for three products. Column B shows the number of units of each product, Column C shows the profit per unit for each product, and Column D contains formulas that calculate the total profit for each product by multiplying the units by the profit per unit.

On the CD

This workbook, named three products.xlsx, is available on this book’s CD-ROM. n

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Part V: Analyzing Data with Excel

FIGURE 37.3

Use Solver to determine the number of units to maximize the total profit.

You don’t need an MBA degree to realize that the greatest profit comes from Product C. Therefore, to maximize total profit, the logical solution is to produce only Product C. If things were really this simple, you wouldn’t need tools such as Solver. As in most situations, this company has some constraints that must be met:

The combined production capacity is 300 total units per day.

The company needs 50 units of Product A to fill an existing order.

The company needs 40 units of Product B to fill an anticipated order.

Because the market for Product C is relatively limited, the company doesn’t want to produce more than 40 units of this product.

These four constraints make the problem more realistic and a bit more challenging. In fact, it’s a perfect problem for Solver.

I go into more detail in a moment, but here is the basic procedure for using Solver:

1.Set up the worksheet with values and formulas. Make sure that you format cells logically; for example, if you can’t produce partial units of your products, format those cells to contain numbers with no decimal values.

2.Choose Data Analysis Solver to bring up the Solver Parameters dialog box.

3.Specify the target cell.

4.Specify the range that contains the changing cells.

5.Specify the constraints.

6.Change the Solver options, if necessary.

7.Let Solver solve the problem.

To start Solver to tackle this example, choose Data Analysis Solver. Excel displays its Solver Parameters dialog box, shown in Figure 37.4.

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Chapter 37: Analyzing Data Using Goal Seeking and Solver

FIGURE 37.4

The Solver Parameters dialog box.

In this example, the target cell is D6 — the cell that calculates the total profit for three products.

1.Enter D6 in the Set Objective field of the Solver Parameters dialog box.

2.Because the objective is to maximize this cell, select the Max option button.

3.Specify the changing cells (which are in the range B3:B5) in the By Changing Variable Cells field. The next step is to specify the constraints on the problem. The constraints are added one at a time and appear in the Subject to the Constraints list.

4.To add a constraint, click the Add button. Excel displays the Add Constraint dialog box, shown in Figure 37.5. This dialog box has three parts: a Cell Reference, an operator, and a Constraint value.

FIGURE 37.5

The Add Constraint dialog box.

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Part V: Analyzing Data with Excel

5.To set the first constraint (that the total production capacity is 300 units), enter B6 as the Cell Reference, choose equal (=) from the drop-down list of operators, and enter 300 as the Constraint value.

6.Click Add, and enter the remaining constraints. Table 37.1 summarizes the constraints for this problem.

TABLE 37.1

Constraints Summary

Constraint

Expressed As

Capacity is 300 units

B6=300

At least 50 units of Product A

B3>=50

At least 40 units of Product B

B4>=40

No more than 40 units of Product C

B5<=40

7.After you enter the last constraint, click OK to return to the Solver Parameters dialog box, which now lists the four constraints.

8.For the Solving Method, use the default, GRG Nonlinear.

9.Click the Solve button to start the solution process. You can watch the progress onscreen, and Excel soon announces that it has found a solution. The Solver Results dialog box is shown in Figure 37.6.

FIGURE 37.6

Solver displays this dialog box when it finds a solution to the problem.

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Chapter 37: Analyzing Data Using Goal Seeking and Solver

At this point, you have the following options:

Keep the solution that Solver found.

Restore the original changing cell values.

Create any or all three reports that describe what Solver did.

Click the Save Scenario button to save the solution as a scenario so that Scenario Manager can use it (see Chapter 36).

The Reports section of the Solver Results dialog box lets you select any or all of three optional reports. If you specify any report options, Excel creates each report on a new worksheet, with an appropriate name. Figure 37.7 shows an Answer Report, in the form of a collapsible outline (I chose the Outline Reports check box in the Solver Results dialog box). In the Constraints section of the report, three of the four constraints are binding, which means that these constraints were satisfied at their limit with no more room to change.

This simple example illustrates how Solver works. The fact is, you could probably solve this particular problem manually just as quickly. That, of course, isn’t always the case.

FIGURE 37.7

One of three reports that Solver can produce.

Which tool helps in what if analysis in MS Excel a track change B formula auditing C Goal Seek D pivot table?

Part V: Analyzing Data with Excel

Caution

When you close the Solver Results dialog box (by clicking either OK or Cancel) the Undo stack is cleared. In other words, you cannot undo any changes that Solver makes to your workbook. n

More about Solver

Before presenting more complex examples, this section discusses the Solver Options dialog box. From this dialog box, you control many aspects of the solution process, as well as load and save model specifications in a worksheet range.

Usually, you want to save a model only when you’re using more than one set of Solver parameters with your worksheet. This is because Excel saves the first Solver model automatically with your worksheet (using hidden names). If you save additional models, Excel stores the information in the form of formulas that correspond to the specifications. (The last cell in the saved range is an array formula that holds the options settings.)

It’s not unusual for Solver to report that it can’t find a solution, even when you know that one should exist. Often, you can change one or more of the Solver options and try again. When you click the Options button in the Solver Parameters dialog box, Excel displays the Solver Options dialog box, shown in Figure 37.8.

FIGURE 37.8

You can control many aspects of how Solver solves a problem.