where PV is present value, R is the interest rate, and N is the number of investment periods.
- Use a Fixed Formula
- Create a Function Macro to Determine Compound Interest
Use a Fixed FormulaThe following formula typed into a cell on a worksheet, returns the correct value of $1,259.71:
Create a Function Macro to Determine Compound InterestMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
A custom function is more flexible because none of the actual raw data is 'hard-coded' into the function; the user just types the data for the calculation instead of the actual calculation. To create this custom function, type the following code in a new Visual Basic module:
Function Yearly_Rate(PV, R, N) As Double
Yearly_Rate = PV*(1+R)^N 'Performs computation
To use the custom function, follow these steps:
- Type the following values in your worksheet:
These values represent the following:
- A1: Present value of the investment
- A2: Interest rate
- A3: Number of investment periods
- In any blank cell, type the following formula=Yearly_Rate(A1,A2,A3)where A1, A2, and A3 are the cells that contain the present value, interest rate, and number of investment periods respectively.
Id. de artículo: 191017 - Última revisión: 06/17/2005 - Revisión: 1