Normal Topic Compounded Interest Calculator Program (Read 12243 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Compounded Interest Calculator Program
Nov 22nd, 2007 at 8:46pm
Print Post Print Post  
Anyone seen a good example of programming involved for compunding interest on specified amounts on a daily basis?

Thanks,

Louis Galvao
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Compounded Interest Calculator Program
Reply #1 - Nov 27th, 2007 at 12:39am
Print Post Print Post  
The formula for daily compounded interest usually looks like this:

V = D(1 + r/365)365n

D is the principal
r is the interest rate
n is the number of years
V is the final amount

Will that do? If not, can you describe the task a bit more?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Compounded Interest Calculator Program
Reply #2 - Nov 27th, 2007 at 1:51pm
Print Post Print Post  
Hi Erika:

Just looking for a shortcut to any sample databases that may be floating out there in cyber space.

In the tax field, we just typically use excel spreadsheets to verify interest calculations from auditors and I will likely try to create a sample database to standardize this process.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
beamer
Member
*
Offline


No personal text

Posts: 3
Joined: Sep 22nd, 2005
Re: Compounded Interest Calculator Program
Reply #3 - Nov 27th, 2007 at 6:43pm
Print Post Print Post  
I do not have an example db for you, however it could be built fairly simply.  You would need to create a form with a total of 5 fields.  2 date fields to enter the range of dates the money will earn interest, a field to enter the interest rate, a field to enter the principal amount, and a field to have the new balance show up in.  The code to then calculate the compounded interest would then look something like this:


var vTo as Int
var vFrom as Int
var vDays as Int

     vTo = @ToNumber(ToDate)
     vFrom = @ToNumber(FromDate)      
     If vTo >= vFrom
     {
           vDays = (vTo - vFrom)
           //the below line assumes that the interest rate is inserted as a percent and not a decimal
           TotBalance = Principal * (@EXP(1 + InterestRate / 36500, vDays))
     }
     Else
     {
           @MsgBox("The date the principal stops earning interest cannot be earlier than when it begins earning interest.")
     }
     
« Last Edit: Nov 27th, 2007 at 7:55pm by beamer »  
Back to top
 
IP Logged