Search blogs
Did you find a problem ? Tell us about it! Get a blog Report blog Random blog

Excel PMT in Javascript

Posted on 08/02/2006

Ok, here's how you should calculate it.

function PMT (ir, np, pv, fv ) {
 /*
 ir - interest rate per month
 np - number of periods (months)
 pv - present value
 fv - future value (residual value)
 */
 pmt = ( ir * ( pv * Math.pow ( (ir+1), np ) + fv ) ) / ( ( ir + 1 ) * ( Math.pow ( (ir+1), np) -1 ) );
 return pmt;
}

Let's buy a car priced at 10000$ with 30% advance, 20% residual value and 8% interest rate in 24 months.

present_value = 10000;

interest_rate = 8/100 / 12; // per month
number_periods = 24;
advance = present_value*30/100;
financed = present_value - advance;
residual_value = present_value*20/100;

rate = PMT ( interest_rate, number_periods, financed, residual_value );

Tags: excel , pmt , javascript
These icons link to social bookmarking sites where readers can share and discover new web pages. Bookmark page
  • digg
  • del.icio.us
  • YahooMyWeb
  • Furl
  • Fark
  • Ma.gnolia
  • Reddit
  • Smarking
  • Spurl
  • NewsVine
  • blinkbits
  • Yahoo Messenger
Razvan @ 11:33
Filed under: opensource

No comments have been added to this post yet.

No trackbacks have been added to this post yet.

Leave a comment





Human test

Information for comment users
Your e-mail address is never displayed. Please consider what you're posting.