Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel PMT function in Java

Tags:

java

I want to implement PMT function (from Excel) in Java. The formula of the PMT function is:

(D7*D9/12)/(1-(1+D9/12)^(-(D11/12)*12))

where:

  • D7 = Finance Amount
  • D9 = Rate
  • D11 = Term

For example

D7 = $1,00,000,
D9 = 10%,
D11 = 36

Here the output of PMT function i.e. monthly payment will be $3,226.72

Please anyone help me to calculate this function value in Java.

like image 606
Debarati Avatar asked Jul 24 '26 08:07

Debarati


1 Answers

You can use Apache POI:

http://poi.apache.org/apidocs/org/apache/poi/ss/formula/functions/FinanceLib.html

It saves my day :D

Usage example:

FinanceLib.pmt(0.00740260861, 180, -984698, 0, false)

Parameters: rate, months, present value, future value, at the beginning of the period (or at the end)

like image 144
Fredy Bello Avatar answered Jul 28 '26 14:07

Fredy Bello



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!