Вы находитесь на странице: 1из 9

# *

## slight bug fix: July 12, 2003

Chapter contents
Introduction..................................................................................................................................... 1

## 32.2. Using Goal Seek and Solver: a simple example .................................................................. 4

32.3. What’s the difference between Solver and Goal Seek? ........................................................ 7

EXERCISES ................................................................................................................................... 9

Introduction

Goal Seek and Solver are Excel tools that to produce targeted results from your models

(the technical jargon is “calibrate your model”). If this sentence sounds a bit dense, read on—

## you’ll see that these tools are extremely useful.

Although Solver is a much more sophisticated tool than Goal Seek, we won’t use many

of its more advanced capabilities. For our purposes, Goal Seek and Solver are thus largely

interchangeable—they can both do most of the financial tasks that we require, and they are not

*
Notice: This is a preliminary draft of a chapter of Principles of Finance with Excel by Simon Benninga

(benninga@wharton.upenn.edu). Check with the author before distributing this draft (though you will probably get

permission). Make sure the material is updated before distributing it. All the material is copyright and the rights

## PFE Chapter 32, Goal Seek and Solver page 1

difficult to use. When you get used to them, you’ll probably find that Solver is preferable,

because it “remembers” its arguments (at this stage you won’t understand this, but read on).

## 32.1. Installing Solver

Both of these tools come with the standard Excel package, but Solver has to be installed.

## PFE Chapter 32, Goal Seek and Solver page 3

32.2. Using Goal Seek and Solver: a simple example

We’ll start with a high-school algebra example: Suppose we’re trying to graph the

## equation y = x3 + 2 x 2 − 3 x + 121 . We can do this in Excel as follows:

A B C D E F G
1 SIMPLE EXAMPLE
2 x 5.166147 Table
3 y 21.00001 <-- =-B2^3+2*B2^2-3*B2+121 x y
4 -9 1039 <-- =-E4^3+2*E4^2-3*E4+121
5 -8 785 <-- =-E5^3+2*E5^2-3*E5+121
6 1500 -7 583 <-- =-E6^3+2*E6^2-3*E6+121
7 -6 427 <-- =-E7^3+2*E7^2-3*E7+121
8 1000 -5 311
9 -4 229
10 -3 175
11 500 -2 143
12 -1 127
13 0 121
0
14 -10 -5 0 5 10 15
1 119
15 2 115
16 -500 3 103
17 4 77
18 5 31
-1000
19 6 -41
20 7 -145
21 -1500 8 -287
22 9 -473
23 10 -709
24 11 -1001

## PFE Chapter 32, Goal Seek and Solver page 4

Notice that we’ve put the function in twice: In cells B2:B3, we’ve got a simple example

of the function (one value of x and its corresponding y value); in the table to the right, we’ve got

the table for the graph (many values of x and many values of y).

Now we want to find the x such that the corresponding y is 21. You can tell from the

table that the value will be somewhere between 5 and 6. To solve for it, we go to the Excel

command Tools|Goal Seek. This brings up a dialogue box, which we fill in as below:

## Hitting OK again, accepts this answer:

A B C
1 SIMPLE EXAMPLE
2 x 5.166147
3 y 21.00001 <-- =-B2^3+2*B2^2-3*B2+121

## PFE Chapter 32, Goal Seek and Solver page 5

Doing the same thing with Solver

We can do the same calculation with Solver. On the same spreadsheet, we go to the

command Tools|Solver. This brings up a dialogue box which we fill in as follows (note that we

changed the question a bit—this time we’re asking for the x value which gives a y = -58):

## PFE Chapter 32, Goal Seek and Solver page 6

32.3. What’s the difference between Solver and Goal Seek?

Solver and Goal Seek serve much the same purpose. Nevertheless, there are several

## Solver remembers, Goal Seek forgets

Suppose you’ve got another question: For which x will y=158? If you use Goal Seek to

answer this question, you’ll have to re-enter all the values into the dialogue box. But if you use

Solver, you’ll see that it comes up with the previous set of values—you only have to change the

## entry into the Value of box:

This “memory” of Solver carries over even if you save the file and reopen it later.

## PFE Chapter 32, Goal Seek and Solver page 7

Solver is more flexible

Again we use an algebra example, but this time we use the function y = x 2 − 7 x − 14 .

## This function is a simple parabola:

A B C D E F
1 SECOND EXAMPLE
2 x 5 Table
3 y -24 <-- =B2^2-7*B2-14 x y
4 -9 130
5 -8 106
6 140 -7 84
7 -6 64
8 120 -5 46
9 -4 30
100
10 -3 16
11 80 -2 4
12 -1 -6
13 60 0 -14
14 1 -20
40
15 2 -24
16 20 3 -26
17 4 -26
18 0 5 -24
19 -10 -5 0 5 10 15 6 -20
-20
20 7 -14
21 -40 8 -6
22 9 4
23 10 16
24 11 30

Now suppose we want to find x such that y = 21. As you can see above, there are 2 such

x’s: One is between –3 and –4, and the other is between 10 and 11. If you use Goal Seek, you

## PFE Chapter 32, Goal Seek and Solver page 8

Here we’ve used Add to enter 2 constraints on x. Pressing Solve gives the correct