06 October 2019

Salient Features of This Compound Interest Calculator


1. Capable of compounding interest on daily, weekly, monthly, quarterly, half-yearly and annual basis


2. Interest percentage needs to be entered as an integer (no decimal values required)


3. Decimal interest percentage values can be entered


4. Shows the growth of investment through an interactive plot. Total interest earned can be seen on plot


5. Shows the growth of investment through an interactive plot. Total interest earned can be seen on plot

Calculation Logic and Glossary

Formula:

Principal * (1 + Interest Rate / Compounding Interval) ^ (Number of Time Periods * Compounding Interval)

Definitions:

Principal = Investment Amount

Interest Rate = Rate of interest per year

Number of Time Periods = Number of total terms for initial investment

Compounding Interval = Intervals at which investment will get compounded (Daily, Weekly, Monthly, Quarterly, Half-Yearly and Annually)

Compound Interest = Compound Interest Amount after given period

Amount = Total Amount (Principal + Compound Interest)

How To Use This Compound Interest Calculator

1. Enter the investment amount (integer or decimal values)

2. Enter the annual interest rate (integer or decimal values e.g, 5, 5.25)

3. Choose the number of time periods on slider scale (1 to 50)

4. Select compounding intervals from drop-down values (Daily, Weekly, Monthly, Quarterly, Half-Yearly & Annually)

5. Click on button ‘Calculate Amount’

6. View results on right panel along with a plot output


Link to access the app:
https://yogesh-dhar.shinyapps.io/Interactive_Compound_Interest_Calculator/


Link to access my Shiny codes (ui.R and server.R):
https://github.com/yogesh-dhar/Compound-Interest-Calculator

Example of Compound Interest Calculation

Note that I have used more complex logic in my server.R code to tackle the compounding factor (from Daily to Annual)
input_Principal <- 1000 
input_Interest <- 10 #Percentage entered as integer
Interest_df <- NULL #Set a blank data frame
for (i in 1:10) { #Run a loop for 10 years
  input_Principal <- input_Principal*(1+input_Interest/100) #Formula: P*(1+R/100)^n (used For loop for 'n')
  Interest_df <- rbind(Interest_df, input_Principal-1000) #Y-O-Y amount less initial principal
 }
Interest_df <- as.data.frame(Interest_df)
Interest_df <- cbind(Interest_df, 1:10) #Fuse years from 1 to 10 with Compound Interest column
names(Interest_df) <- c("Compound Interest", "Year Number")
Interest_df
##    Compound Interest Year Number
## 1           100.0000           1
## 2           210.0000           2
## 3           331.0000           3
## 4           464.1000           4
## 5           610.5100           5
## 6           771.5610           6
## 7           948.7171           7
## 8          1143.5888           8
## 9          1357.9477           9
## 10         1593.7425          10