>>>>Can anyone help me convert this Excel formula to FoxPro.
>>>>
>>>>=RATE(N,-((P+Z)/N),P)*12
>>>>
>>>>Thanks
>>>
>>>Julie,
>>>
>>>In addition to Hilmar's reply, I do not think there's any way to do it but iteration
>>>
>>>
>>>In case of a loan
>>>
>>>n = number of periods (eg months)
>>>i = % intrest per period (ie 3%/year = .03 becomes 3/12% or .25% or .0025 /month if month = period)
>>>pmt = payment per period
>>>pv = initial amount or capital
>>>fv = 0 at the end
>>>type = 0, we pay at the end of each period
>>>
>>>then
>>>
>>>pmt = pv * i
>>> ---------------------
>>> 1
>>> 1 - ----------
>>> (1 + i) ^ n
>>>
>>>
>>>There's no way - that I know of - to get the i isolated to either side of the equation (in order to get i = ....)
>>>
>>
>>Actually, it is possible in many cases to "solve" for one variable, in such a way that the variable also appears in the right side. Then, applying the formula iteratively (assigning an arbitrary initial value), repeated calculations will usually get closer and closer - or farther and farther - from the real solution, depending on which "solution" of the equation is used, i.e., for which of the "i's", in this case, it is "solved".
>>
>>Of course, as outlined above, this procedure is still iterative. Simply put, not all equations can be solved without some numerical method (such as iteration).
>
>The I don't see how is this different from VFP's payment() function. It does the same thing.
I think those are different functions. payment() gives the amount, for a number of constant payments. The interest rate is known. Julie wants to know the interest rate (I think).
Perhaps the functions are related, but I wouldn't know how to calculate one from the other.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)