Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Interest Paid IPMT Excel equivelant

1. Pardon me, but that's a clumsy way to do it.

And it doesn't really answer the question. You'd still have to add up the interest paid from payment number XXX to the end of the loan.

2. Originally Posted by Old Pedant
Pardon me, but that's a clumsy way to do it.
What is clumsy?

3. I do not understand clumsy but it's our official method ! See this page

NB : With the wrong banker's methods, the real rate is not 12% (to take your example) but Math.pow(1.01,12) which is 12,68% !

4. Originally Posted by 007julien
I do not understand clumsy but it's our official method ! See this page

NB : With the wrong banker's methods, the real rate is not 12% (to take your example) but Math.pow(1.01,12) which is 12,68% !
Well, that is the interest compounded monthly rather than yearly. Of course, compounding can be continuous, as well as yearly, monthly etc.

Clumsy in French is gauche or maladroit. Perhaps not exactly the same meaning.

5. It's clumsy because to answer the original question what you have to do is
(1) Run the loop from the first period to the period number in question and then throw away any results you get from that.
(2) Continue the loop to the end, summing up the individual interest amounts.
(3) Present the final sum.

In other words, you perform a whole bunch of operations just to get the same sum you can get via two calculations using the code I showed. (I presented it in several lines of code, for clarity, but there are really only 2 lines of code--other than getting and validating the input and displaying the result--needed.)

Oh, what the heck:
Code:
```      form.calc.onclick = function( )
{
var pv = Number(form.loan.value);
var periods = Number(form.months.value);
var annual = Number(form.apr.value);
var rate = Number(form.remaining.value) / 12 / 100;
if ( isNaN(pv) || isNaN(periods) || isNaN(rate) || isNaN(remain) )
{
return;
}
var pmt = pv / ( ( 1 - Math.pow( 1 + rate, - periods ) ) / rate );
var rintTotal = pmt * remain - pmt * ( ( 1 - Math.pow( 1 + rate, - remain ) ) / rate );
document.getElementById("rintTotal").innerHTML = rinttotal.toFixed(2);
}```
See? Only two *active* lines of code.

6. Eehhh... Okay, maybe it isn't all that clumsy. And if you don't understand or don't know the need formulas then I suppose it's easier to grasp.

Code:
```      form.calc.onclick = function( )
{
var pv = Number(form.loan.value);
var pmt = Number(form.payment.value); // NEW!
var periods = Number(form.months.value);
var annual = Number(form.apr.value);
var rate = Number(form.remaining.value) / 12 / 100;
if ( isNaN(pv) || isNaN(pmt) || isNaN(periods) || isNaN(rate) || isNaN(remain) )
{
return;
}
var inttotal = 0;
for ( var p = 1; p <= periods; ++p )
{
var ipaid = pv * rate;
if ( p > periods - remain ) { inttotal += ipaid; }
pv -= ( pmt - ipaid );
}
document.getElementById("rintTotal").innerHTML = rinttotal.toFixed(2);
}```
But here the user must supply the payment amount. Presumably pre-calculated by the lending institution.

If it's not supplied, then you have to add in my line to calculate the payment.

And so then you need all the code in red IN ADDITION TO my payment calc.

Page 2 of 2 First 12

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•