
851  Some Excel Hints
The annotation in cell E3 is generated by the formula Getformula(D3), 
and the annotations in other cells are similarly generated.
Getformula has two interesting properties:
•
 It is dynamic: If you change something in your spreadsheet, Getfor-
mula adjusts automatically. As a result, you will never have to worry 
about showing the correct cell contents! Here’s an example: In the 
following spreadsheet, we’ve added a column and a row to the 
computations:
1
2
3
4
5
6
7
8
9
10
ABCDE F G
Year Cash flow
Discount 
rate
Present value
1 100 5% 95.24 <
--
  =C4/(1+D4)^B4 <
--
  =getformula(E4)
2 200 6% 178.00 <
--
  =C5/(1+D5)^B5 <
--
  =getformula(E5)
3 300 7% 244.89 <
--
  =C6/(1+D6)^B6 <
--
  =getformula(E6)
4 500 8% 367.51 <
--
  =C7/(1+D7)^B7 <
--
  =getformula(E7)
Present value 885.64 <
--
  =SUM(E4:E7) <
--
  =getformula(C9)
885.64 <
--
  {=SUM(C4:C7/(1+D4:D7)^B4:B7)} <
--
  =getformula(C10)
USING GETFORMULA IN A SPREADSHEET
We've added a column and a row--Getformula automatically shows the adjusted 
cell formulas
•
  Getformula automatically adds curly brackets { } to array formulas. The 
contents of cell C10 (which was cell B9 in the original example) illustrate 
an array technique discussed in Chapter 34 for computing the present 
value where each cash fl ow has a separate discount rate: 
CF
r
t
t
t
()
.
1+
∑
 
Getformula senses that this is an array formula and puts in the 
brackets.
35.7.1  Adding Getformula to Your Spreadsheet
Getformula is a VBA user-defi ned formula, a topic discussed in Chapter 
36. To add such a formula to your spreadsheet, fi rst open the spreadsheet 
in which you want the formula to work. Push [Alt] + F11. This action will 
open the VBA editor. The screen will look something like the 
following: