Title: Compound interest Formula
Last modified: May 7, 2020

---

# Compound interest Formula

 *  Resolved [leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * (@leontancredimedia)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/)
 * Hi I’m trying to implement a compound interest with monthly contributions formula.
 * However the result of the formula keeps showing a wrong result while when I’m
   doing in my excel everything is working fine.
 * Below the formula used:
    P=Initial Investment; PMT=monthly contribution; r=interest
   rate; n=12; t=years [ P(1+r/n)^(nt) ] + [ PMT × (((1 + r/n)^(nt) – 1) / (r/n))]
 * I implemented it that way in my form:
    (fieldname14*(1+(fieldname16/12))^(12*
   fieldname17))+(fieldname15*(((1+(fieldname16/12)^(12*fieldname17)-1)/(fieldname16/
   12))))
 * Could you please help me understand why I don’t get the right amount which is
   €23,504?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcompound-interest-formula%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12799291)
 * Hello [@leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * In javascript does not exists the `^` operator, you should use the `POW` operation
   instead.
 * 5^2 would be POW(5,2)
 * So, this equation:
 * (fieldname14*(1+(fieldname16/12))^(12*fieldname17))+(fieldname15*(((1+(fieldname16/
   12)^(12*fieldname17)-1)/(fieldname16/12))))
 * need to be edited as follows:
 *     ```
       fieldname14*POW(1+fieldname16/12,12*fieldname17)+(fieldname15*(((1+POW(fieldname16/12,12*fieldname17)-1)/(fieldname16/12))))
       ```
   
 * However, I think the parenthesis in your original equation are not used in the
   correct places (please, check the maths).
 * Best regards.
 *  Thread Starter [leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * (@leontancredimedia)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12799892)
 * Hi,
 * Thank you so much this definitely helps a lot.
    However still seems like the 
   formula is not giving the right amounts:
 * futureValue=fieldname19*POW((1+(fieldname16/12/100)),(fieldname17*12))+fieldname15*(
   POW((1+(fieldname16/12/100)),(fieldname17*12)+1)-(1+(fieldname16/12/100)))/(fieldname16/
   12/100)
 * Even tried to write it as a full javascript with vars but still didn’t worked:
   
   var P = startingAmount; var Y = yearsOfInvesting; var c = getAdditionalContributionsPerPeriod;
   var t = getTermsPerPeriod; var n = t * Y; var r = interestRate / 100 / t; // 
   interestRate [%] var z = 1 + r; total = P * Math.pow(z, n) + c * (Math.pow(z,
   n + 1) – z) / r;
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12801180)
 * Hello [@leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * I think the operations you need are included into the “Financial Operations” 
   module, distributed with the Developer and Platinum versions of the plugin:
 * [https://cff.dwbooster.com/documentation#financial-module](https://cff.dwbooster.com/documentation#financial-module)
 * Best regards.
 *  Thread Starter [leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * (@leontancredimedia)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12801729)
 * Hi,
 * Is there a way to get historical stock and indexes prices with the developer 
   or platinum versions?
 * It’s basically a function that is available in google sheet so was wondering 
   if you allow it too in the premium versions.
 * Thanks
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12801788)
 * Hello [@leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * The plugin gives the tools for calling external APIs and services, but the integration
   with the external APIs and services must be implemented by your own code, and
   depends on the requirements of the external API and/or service to call, and not
   the plugin.
 * Best regards.
 *  Thread Starter [leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * (@leontancredimedia)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12801884)
 * Hi,
    I already implemented API of Stockdio Historical chart. How can I call the
   values of the Stockdio API and apply calculations on it? Thanks
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12801957)
 * Hello [@leontancredimedia](https://wordpress.org/support/users/leontancredimedia/)
 * I’m sorry, I cannot respond to your question because I don’t know your implementation
   of the API, I don’t know the information you are getting from the API, and the
   way you want to use it.
 * Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Compound interest Formula’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/compound-interest-formula/#post-12801957)
 * Status: resolved