Calculate Annually Compounded Interest

From HotDocs Wiki

Jump to: navigation, search

You can write a computation to calculate the future value of an investment with a constant interest rate compounded annually. The following computation is based on a formula that uses three variables to compute the future value (FV): the starting principal amount (P), interest rate (R), and number of years (N).

The scripts below show two ways to calculate annually compounded interest. The first version is broken up into several small calculations, and the second version has everything on one line. Often, it is easier to write and maintain computation scripts if they are broken up into smaller segments like the first version.

Example

//Example 1: Broken up into several small calculations. 
1 + ( Rate / 100 ) POWER( RESULT, Years ) 
Principal Amount * RESULT 
 
ROUND( RESULT, 2 ) 
//Example 2: Entire calculation on one line. 
ROUND( Principal Amount * POWER( ( 1 + (Rate / 100 ) ), Years ), 2 )

Rate The annual percentage rate. The computation divides this number by 100 to calculate the value for R in the formula.
Principal Amount The principal amount ( P ).
Years The number of years ( N ).