CHAPTER 0, DATA TABLES * slight bug fix: July, 00 Chapter contents Overview... 0.. A simple example... 0.. Summary: How to do a one-dimensional data table... 0.. Some notes on data tables... 0.. Two dimensional data tables... EXERCISES... 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 0, Data tables page
0.. A simple example If we deposit $0 today and leave it in a bank drawing % interest for years, what will be its future value? As the example below shows, the answer is $0.: A B C DATA TABLE EXAMPLE Interest rate % Initial deposit 0 Years Future value $0. <-- =B*(+B)^B Now suppose we want show the sensitivity of the future value to the interest rate. In cells A:A we have put interest rates varying from 0% to 0%, and in cell B we have put =B, which refers to the initial calculation of the future value. A B C DATA TABLE EXAMPLE Interest rate % Initial deposit 0 Years Future value $0. <-- =B*(+B)^B Interest rate 0% % 0% 0% 0% 0% 0% $0. <-- =B To use the data table technique we mark the range A:B and then use the command Data Table. Here s the way the screen looks at this point: PFE Chapter 0, Data tables page
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 0, Data tables page
When you press OK you get the result: A B C DATA TABLE EXAMPLE Interest rate % Initial deposit 0 Years Future value $0. <-- =B*(+B)^B Interest rate $0. <-- =B 0% 0 %. 0%. 0%. 0%. 0%.0 0%. 0.. Summary: How to do a one-dimensional data table Create an initial example Set up a range with: PFE Chapter 0, Data tables page
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 =B 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 DATA TABLE EXAMPLE Interest rate % Initial deposit 0 Years Future value $0. <-- =B*(+B)^B Interest rate 0% % % % 0% % 0% Blank cell when variable is in column $0. <-- =B Here s the blank cell when the variable is in a row: E F G H I J K L Blank cell when variable is in row 0% % % % 0% % 0% $0. =B 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 0, Data tables page
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 DATA TABLE EXAMPLE Interest rate % Initial deposit 0 Years Future value $0. <-- =B*(+B)^B Blank cell when variable is in column Blank cell when variable is in row Interest rate $0. <-- =B 0% % % % 0% % 0% 0% 0 $0. 0.. 0.... %. %. =B % 0. 0%. %. 0%. PFE Chapter 0, Data tables page
0.. 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 DATA TABLE EXAMPLE Interest rate % Initial deposit 0 Years Future value $0. <-- =B*(+B)^B Interest rate $0. <-- =B 0% 0 %. 0%. 0%. 0%. 0%.0 0%. Here s another example: We change the function we re calculating, putting =FV(B,B,-B,,) in cell B, as explained in Chapter, this function calculates the future value of annual $0 deposits starting today and accumulating interest at % for years. Note that we ve also changed the text in cell A from initial deposit to annual deposit to reflect what s now happening. As we also explained in Chapters and, we put the minus sign before B because otherwise for reasons beyond logic Excel produces a negative future value. Note that if we had typed FV(B,B,-B) the assumption is that there are deposits starting one year from now. PFE Chapter 0, Data tables page
When we press OK, both the example and the data table update: A B C DATA TABLE EXAMPLE Interest rate % Initial deposit 0 Years Future value $,. <-- =FV(B,B,-B,,) Interest rate. <-- =B 0% 00 %. 0%.0 0% 0. 0%. 0%. 0% 0. 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 0, Data tables page
You can hide the cell header but not erase it The formula at the top of the table s second column (cell B in our case, containing the reference to cell B) 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 B. We then use the command Format Cells and go to Number Custom. Typing a semicolon in the Type box hides the cell: PFE Chapter 0, Data tables page
Here s the result: A B C Interest rate <-- =B 0% 00 %. 0%.0 0% 0. 0%. 0%. 0% 0. PFE Chapter 0, Data tables page
0.. 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 B:H: A B C D E F G H I DATA TABLE EXAMPLE Interest rate % Annual deposit 0 Years Future value $,. <-- =FV(B,B,-B,,) Two-dimensional table, showing sensitivity of future value to both interest rate and deposit size =B $,. 0% % % % 0% % 0 0 0 00 0 00 This time we indicate in the Data Table command that there are two variables: This creates a two-dimensional table: PFE Chapter 0, Data tables page
B C D E F G H $,. 0% % % % 0% % 0 00.00 0..,.,.,0. 0,000.00,0.,.,.,.0,. 0,00.00,.0,.,0.,.,. 00,000.00,.,0.,.,0.0,. 0,00.00,0.0,.,.,.0,. 00,000.00,.0,.,00.,.,. EXERCISES. The spreadsheet below shows the value of the function ( ) the indicated data table and use it to graph the function in the range (-,). 0 A B C D x f(x) <-- =B^+*B- Data table - - - - - 0 <-- =B f x = x + x for x=. Create. 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- cash flow (currently $,000). Use a range of $,000 - $,000 in increments of $00. PFE Chapter 0, Data tables page
b. Create a two-dimension data table showing the sensitivity of NPV to the year- cash flow and to the discount rate. Use the same range for the cash flow as above and use discount rates from % to 0%, with increments of %. 0 A B C D E Discount rate % Cost 0,000 Cash flow growth % Year Cash flow 0 (0,000.00) <-- =-B,000.00,00.00 <-- =B*(+$B$),.00 <-- =B*(+$B$),.,.,.,.,0.0,.,. NPV,. <-- =NPV(B,B:B)+B IRR 0.% <-- =IRR(B:B). Project A and Project B cash flows are given in the spreadsheet below. Recreate the Data Table in cells A:C and create the graph. Notice that the Data Table headers in cells B:C have been hidden (see Section 0. 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 for a better solution.) PFE Chapter 0, Data tables page
0 0 A B C D E F G H I Discount rate % Year Project A cash flow Project B cash flow 0 -,000 -,000 0 00 0 00 0 00 0 00 0 00 0 0 0 0 0 0 0 0 0 0 NPV.. <-- =NPV($B$,C:C)+C IRR.% 0.% <-- =IRR(C:C) NPV A NPV B 0%,00.00,000.00 %. 0. %.0 0. %.. %.. %.0. %.0. %. 0. %.. % -.0. 0% -.. % -.0 -. % -. -. % -. -. % -0. -. 0% -. -0. TWO INVESTMENTS AND THEIR NPVs <-- The data table headers have been hidden; see Chapter 0 for details,00.00,00.00,000.00 00.00 00.00 00.00 00.00 0.00-00.00 -% % % % % % -00.00 NPV A NPV B. Finance texts always have tables which give the present value factor for an annuity: PV factor for annuity of $ N for N years =. t= t ( + r) As illustrated below in Excel these present value factors are created with the PV function: PFE Chapter 0, Data tables page
A B C D E F G H I J K r % T PV factor. <-- =PV(B,B,-) ANNUITY TABLE Number of periods PRESENT VALUE OF AN ANNUITY OF $ FOR N PERIODS % % % % % % % % % % Use Data Table to create the table in the template above.. (Do this example only if you ve studied Chapter on option pricing.) The Black-Scholes option pricing model, defined in Chapter, prices call and put options based on 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 σ = %, %, 0%,, 0%? PFE Chapter 0, Data tables page
b. Using the parameters shown below, what are the call and put prices when T = 0., 0., 0.,,? A B C The Black-Scholes Option-Pricing Formula S X T r Sigma d d 0 Current stock price 0 Exercise price 0.0000 Time to maturity of option (in years).00% Risk-free rate of interest % Stock volatility 0.0 <-- (LN(S/X)+(r+0.*sigma^)*T)/(sigma*SQRT(T)) 0. <-- d -sigma*sqrt(t) N(d ) 0. <-- Uses formula NormSDist(d ) N(d ) 0. <-- Uses formula NormSDist(d ) Call price. <-- S*N(d )-X*exp(-r*T)*N(d ) Put price. <-- call price - S + X*Exp(-r*T): by Put-Call parity PFE Chapter 0, Data tables page