Sunteți pe pagina 1din 16

CHAPTER 30, DATA TABLES*

slight bug fix: July 12, 2003

Chapter contents
Overview......................................................................................................................................... 1

30.1. A simple example ................................................................................................................. 2

30.2. Summary: How to do a one-dimensional data table ............................................................ 4

30.3. Some notes on data tables ..................................................................................................... 7

30.4. Two dimensional data tables............................................................................................... 11

EXERCISES ................................................................................................................................. 12

Overview

Data tables are Excel’s most sophisticated way of doing sensitivity analysis. They are a

bit tricky to implement, but the effort of learning them is well worth it!

*
Notice: This is a preliminary draft of a chapter of Principles of Finance 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 belong to the author.

PFE Chapter 30, Data tables page 1


30.1. A simple example

If we deposit $100 today and leave it in a bank drawing 15% interest for 10 years, what

will be its future value? As the example below shows, the answer is $404.56:

A B C
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Initial deposit 100
4 Years 10
5 Future value $404.56 <-- =B3*(1+B2)^B4

Now suppose we want show the sensitivity of the future value to the interest rate. In cells

A10:A16 we have put interest rates varying from 0% to 60%, and in cell B9 we have put =B5,

which refers to the initial calculation of the future value.

A B C
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Initial deposit 100
4 Years 10
5 Future value $404.56 <-- =B3*(1+B2)^B4
6
7
8 Interest rate
9 $404.56 <-- =B5
10 0%
11 10%
12 20%
13 30%
14 40%
15 50%
16 60%

To use the data table technique we mark the range A9:B16 and then use the command

Data|Table. Here’s the way the screen looks at this point:

PFE Chapter 30, Data tables page 2


The dialog box asks whether the parameter to be varied is in a row or a

column of the marked table. In our case, the interest rate to be varied is in column A of the table,

so we move the cursor from Row input cell to Column input cell and indicate where in the

original example the interest rate occurs:

PFE Chapter 30, Data tables page 3


When you press OK you get the result:

A B C
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Initial deposit 100
4 Years 10
5 Future value $404.56 <-- =B3*(1+B2)^B4
6
7
8 Interest rate
9 $404.56 <-- =B5
10 0% 100
11 10% 259.3742
12 20% 619.1736
13 30% 1378.585
14 40% 2892.547
15 50% 5766.504
16 60% 10995.12

30.2. Summary: How to do a one-dimensional data table

• Create an initial example

• Set up a range with:

PFE Chapter 30, Data tables page 4


o Some variable in the initial example that will be changed (like the interest

rate in the above example)

o A reference to the initial example (like the =B5 in the above). Note that

you will always have a blank cell next to this reference. Note the blank

cells when the variable is in a column:

A B C D
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Initial deposit 100
4 Years 10
5 Future value $404.56 <-- =B3*(1+B2)^B4
6
7 Blank cell when variable is in column
8 Interest rate
9 $404.56 <-- =B5
10 0%
11 5%
12 10%
13 15%
14 20%
15 25%
16 30%

Here’s the blank cell when the variable is in a row:

E F G H I J K L
6
7 Blank cell when variable is in row
8
9 0% 5% 10% 15% 20% 25% 30%
10 $404.56
11
12 =B5
13

• Bring up the Data|Table command and indicate in the dialog box:

o Whether the variable is in a column or a row

o Where in the initial example the variable occurs:

PFE Chapter 30, Data tables page 5


Variable in column Variable in row

Either way the result will be a sensitivity table:


A B C D E F G H I J K L
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Initial deposit 100
4 Years 10
5 Future value $404.56 <-- =B3*(1+B2)^B4
6
7 Blank cell when variable is in column Blank cell when variable is in row
8 Interest rate
9 $404.56 <-- =B5 0% 5% 10% 15% 20% 25% 30%
10 0% 100 $404.56 100 162.8895 259.3742 404.5558 619.1736 931.3226 1378.585
11 5% 162.8895
12 10% 259.3742 =B5
13 15% 404.5558
14 20% 619.1736
15 25% 931.3226
16 30% 1378.585

PFE Chapter 30, Data tables page 6


30.3. Some notes on data tables

Data tables are dynamic

You can change either your initial example or the variables and the table will adjust.

Here’s an example where we’ve changed the interest rates we want to vary (compare to the

previous example):

A B C
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Initial deposit 100
4 Years 10
5 Future value $404.56 <-- =B3*(1+B2)^B4
6
7
8 Interest rate
9 $404.56 <-- =B5
10 0% 100
11 10% 259.3742
12 20% 619.1736
13 30% 1378.585
14 40% 2892.547
15 50% 5766.504
16 60% 10995.12

Here’s another example: We change the function we’re calculating, putting

=FV(B2,B4,-B3,,1) in cell B5, as explained in Chapter 1, this function calculates the future value

of 10 annual $100 deposits starting today and accumulating interest at 15% for 10 years.1 Note

that we’ve also changed the text in cell A5 from “initial deposit” to “annual deposit” to reflect

what’s now happening.

1
As we also explained in Chapters 1 and 29, we put the minus sign before B3 because otherwise—for reasons

beyond logic—Excel produces a negative future value. Note that if we had typed FV(B2,B4,-B3) the assumption is

that there are 10 deposits starting one year from now.

PFE Chapter 30, Data tables page 7


When we press OK, both the example and the data table update:

A B C
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Initial deposit 100
4 Years 10
5 Future value $2,334.93 <-- =FV(B2,B4,-B3,,1)
6
7
8 Interest rate
9 2334.928 <-- =B5
10 0% 1000
11 10% 1753.117
12 20% 3115.042
13 30% 5540.535
14 40% 9773.913
15 50% 16999.51
16 60% 29053.64

You can only erase the whole table but you cannot erase part of a table

If you try to erase part of a data table, you’ll get an error message:

PFE Chapter 30, Data tables page 8


You can hide the cell header but not erase it

The formula at the top of the table’s second column (cell B9 in our case, containing the

reference to cell B5) is called the “column header.” This formula controls what the data table

calculates. If you want to print a table, you often want to hide the column header. In the

example below, we’ve put the cursor on cell B9. We then use the command Format|Cells and

go to Number|Custom. Typing a semicolon in the Type box hides the cell:

PFE Chapter 30, Data tables page 9


Here’s the result:

A B C
8 Interest rate
9 <-- =B5
10 0% 1000
11 10% 1753.117
12 20% 3115.042
13 30% 5540.535
14 40% 9773.913
15 50% 16999.51
16 60% 29053.64

PFE Chapter 30, Data tables page 10


30.4. Two dimensional data tables

In the example below we return to the FV example discussed above. We want to vary

our initial example with respect to both the interest rate and the initial deposit. The data table is

set up in cells B9:H15:

A B C D E F G H I
1 DATA TABLE EXAMPLE
2 Interest rate 15%
3 Annual deposit 100
4 Years 10
5 Future value $2,334.93 <-- =FV(B2,B4,-B3,,1)
6
7 Two-dimensional table, showing sensitivity of future value to both interest rate and deposit size
8
9 $2,334.93 0% 5% 10% 15% 20% 25%
10 50
11 =B5 100
12 150
13 200
14 250
15 300

This time we indicate in the Data|Table command that there are two variables:

This creates a two-dimensional table:

PFE Chapter 30, Data tables page 11


B C D E F G H
9 $2,334.93 0% 5% 10% 15% 20% 25%
10 50 500.00 660.34 876.56 1,167.46 1,557.52 2,078.31
11 100 1,000.00 1,320.68 1,753.12 2,334.93 3,115.04 4,156.61
12 150 1,500.00 1,981.02 2,629.68 3,502.39 4,672.56 6,234.92
13 200 2,000.00 2,641.36 3,506.23 4,669.86 6,230.08 8,313.23
14 250 2,500.00 3,301.70 4,382.79 5,837.32 7,787.60 10,391.53
15 300 3,000.00 3,962.04 5,259.35 7,004.78 9,345.13 12,469.84

EXERCISES

1. The spreadsheet below shows the value of the function f ( x ) = x 2 + 3 x − 16 for x=3. Create

the indicated data table and use it to graph the function in the range (-10,14).

A B C D
3 x 3
4 f(x) 2 <-- =B3^2+3*B3-16
5
6
7 Data table
8 2 <-- =B4
9 -10
10 -8
11 -6
12 -4
13 -2
14 0
15 2
16 4
17 6
18 8
19 10
20 12
21 14

2. The example below calculates the NPV and IRR for an investment.

a. Create a one-dimensional data table showing the sensitivity of the NPV and IRR to the year-1

cash flow (currently $10,000). Use a range of $9,000 - $12,000 in increments of $500.

PFE Chapter 30, Data tables page 12


b. Create a two-dimension data table showing the sensitivity of NPV to the year-1 cash flow and

to the discount rate. Use the same range for the cash flow as above and use discount rates from

8% to 20%, with increments of 2%.

A B C D E
3 Discount rate 15%
4 Cost 50,000
5 Cash flow growth 6%
6
7 Year Cash flow
8 0 (50,000.00) <-- =-B4
9 1 10,000.00
10 2 10,600.00 <-- =B9*(1+$B$5)
11 3 11,236.00 <-- =B10*(1+$B$5)
12 4 11,910.16
13 5 12,624.77
14 6 13,382.26
15 7 14,185.19
16 8 15,036.30
17 9 15,938.48
18 10 16,894.79
19
20 NPV 11,925.54 <-- =NPV(B3,B9:B18)+B8
21 IRR 20.41% <-- =IRR(B8:B18)

3. Project A and Project B cash flows are given in the spreadsheet below. Recreate the Data

Table in cells A21:C37 and create the graph. Notice that the Data Table headers in cells

B21:C21 have been hidden (see Section 30.3 for details on how to do this).

What is the crossover point of the two lines? (You can use the data table to do this, but

you can also refer to Chapter 3 for a better solution.)

PFE Chapter 30, Data tables page 13


A B C D E F G H I
1 TWO INVESTMENTS AND THEIR NPVs
2 Discount rate 15%
3
Project A Project B
4 Year cash flow cash flow
5 0 -1,000 -1,000
6 1 220 300
7 2 220 300
8 3 220 300
9 4 220 300
10 5 220 300
11 6 220 100
12 7 220 100
13 8 220 100
14 9 220 100
15 10 220 100
16
17 NPV 104.13 172.31 <-- =NPV($B$2,C6:C15)+C5
18 IRR 17.68% 20.64% <-- =IRR(C5:C15)
19
20 NPV A NPV B
21 <-- The data table headers have been hidden; see Chapter 30 for details
22 0% 1,200.00 1,000.00
23 2% 976.17 840.95 1,400.00
24 4% 784.40 701.45
1,200.00
25 6% 619.22 578.48
26 8% 476.22 469.55 1,000.00
27 10% 351.80 372.61
800.00
28 12% 243.05 285.98
29 14% 147.55 208.23 600.00 NPV A
30 16% 63.31 138.18 NPV B
400.00
31 18% -11.30 74.84
32 20% -77.66 17.37 200.00
33 22% -136.90 -34.95
0.00
34 24% -189.99 -82.74
35 26% -237.74 -126.51 -3%
-200.00 2% 7% 12% 17% 22%
36 28% -280.84 -166.71
-400.00
37 30% -319.86 -203.73
38

4. Finance texts always have tables which give the present value factor for an annuity:

N
1
PV factor for annuity of $1 for N years = ∑ .
(1 + r )
t
t =1

As illustrated below in Excel these present value factors are created with the PV function:

PFE Chapter 30, Data tables page 14


A B C D E F G H I J K
1 ANNUITY TABLE
2
3 r 9%
4 T 5
5 PV factor 3.8897 <-- =PV(B3,B4,-1)
6
7

Number of
8 periods PRESENT VALUE OF AN ANNUITY OF $1 FOR N PERIODS
9 1% 2% 3% 4% 5% 6% 7% 8% 9% 10%
10 1
11 2
12 3
13 4
14 5
15 6
16 7
17 8
18 9
19 10

Use Data Table to create the table in the template above.

5. (Do this example only if you’ve studied Chapter 24 on option pricing.) The Black-Scholes

option pricing model, defined in Chapter 24, prices call and put options based on 5 parameters:

• S, the stock price today

• X, the option’s exercise price (also called the option’s strike price)

• T, the option’s expiration date

• r, the interest rate

• σ (“Sigma”), the riskiness of the stock

These inputs and the resulting call and put prices are highlighted below.

Your assignment: Use Data Table to create tables showing the sensitivity of the call and

put prices to the various inputs. Here are some suggestions:

a. Using the parameters shown below, what are the call and put prices given σ = 10%,

15%, 20%, … , 80%?

PFE Chapter 30, Data tables page 15


b. Using the parameters shown below, what are the call and put prices when T = 0.1, 0.2,

0.3, … , 1?

A B C
1 The Black-Scholes Option-Pricing Formula
2 S 100 Current stock price
3 X 90 Exercise price
4 T 0.50000 Time to maturity of option (in years)
5 r 4.00% Risk-free rate of interest
6 Sigma 35% Stock volatility
7
8 d1 0.6303 <-- (LN(S/X)+(r+0.5*sigma^2)*T)/(sigma*SQRT(T))
9 d2 0.3828 <-- d1-sigma*SQRT(T)
10
11 N(d1) 0.7357 <-- Uses formula NormSDist(d1)
12 N(d2) 0.6491 <-- Uses formula NormSDist(d2)
13
14 Call price 16.32 <-- S*N(d1)-X*exp(-r*T)*N(d2)
15 Put price 4.53 <-- call price - S + X*Exp(-r*T): by Put-Call parity

PFE Chapter 30, Data tables page 16

S-ar putea să vă placă și