Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Excel Formula to FoxPro
Message
From
19/08/2007 16:32:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
19/08/2007 16:01:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01249012
Message ID:
01249044
Views:
20
>>>>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform