I am programming for "APR" annual percentage rate in a mortgage project. . .VB Foxpro 6 has no function like Rate() in Visual Basic or =Rate() in Excel. . .any guidance on an easy way to calculate this? <br>
THX for any suggestions you might share. . .
Have You looked at these 3 commands?<br>
<br>
Payment()<br>
PV()<br>
FV()<br>
<p>David W. Grewe<br><a href=mailtoave@internationalbid.net>Dave@internationalbid.net</a><br><a href= > </a><br>
The following is from the Excel help:<br><i>Returns the interest rate per period of an annuity. RATE is calculated by iteration and can have zero or more solutions. If the successive results of RATE do not converge to within 0.0000001 after 20 iterations, RATE returns the #NUM! error value.</i><br><br>It sounds like Excel uses brute-force (iteration) to derive the answer. It appears any VFP routine will have to use the same method. I know this is not a great help, but maybe one more financially savvy than I can map out (at least in pseudo-code) what the function needs to do.
We are building Rate()function in Visual Basic FoxPro6, which does not have rate() function. . .Term=360 <br>months,Payment=$665.30 month level, Note Rate= 7%<br>Loan Costs=$3000, PV=$97k, FV=$0,"answer from excel @rate",APR=7.305% Visual Basic=APR=(RATE(360,-665.30,97000,0,.1)*12)*100 &&excel uses iteration. . .brute force. The algebric formula we trying to use is: (FV/PV)raised to the 1/term minus 1. .((0/97000)^1/360)-1<br>Looking to factor to get rid of the fractional exponent.<br>Any recommendations on how to build this in "hard code"?<br>or do we have to go around the barn from a different way?<br>Thank you in advance for any directions. . .<br>Bill
I'm not sure exactly what you need but the following is a short procedure or method that will calculate monthly payments.<br><br>Procedure Payment <br>Paramters Principal,Rate,NumOfMonths<br>set decimal to 2<br><br>*Auto loan of 13,500.00 to be paid back in 48 monthly payments<br>*at a rate of 7.5 percent. <br>*What will the monthly payment be?<br>*The number 12 in the formula designates [Months in a year]<br>*Then with the parameters passed with following values:<br><br>*Principal = 13500.00 <br>*Rate = 0.075<br>*NumOfMonths = 48 <br><br>MonthlyPayment = ((Principal*(Rate/12))* ((1+(Rate/12))^48)) / (((1+(Rate/12))^48)-1)<br><br><br><br>*MonthlyPayment = 326.42.<br><br>Return MonthlyPayment <br><br>***********************<br><br>Hope this helps<br>Blackie<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.