Solved

Excel RATE() function algorithm

Posted on 2010-11-11
3
1,201 Views
Last Modified: 2012-06-21
I am looking for the algorithm used to define the RATE() function in excel. I'd prefer it to be in ruby.
It needs to have the same params as the excel function: RATE( number_payments, payment, PV, FV, Type, Estimate ). FV, Type and Estimate seem to be optional as they take default values.

This doesn't seem to do the trick for me: http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Q_20531809.html
0
Comment
Question by:tsc9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
Jose Parrot earned 500 total points
ID: 34120119
Seems the trick at the cited ee answer is the way.

PV and FV are values calculated by formula. This is not the case of RATE, which is calculated by iterations, say by a sequence of tryings.

As an example, you may calculate the square root of the number N by iteration of multiplications.
You start with L and U such that       L*L < N        and        U*U > N.     Then loop by making U smaller and smaller  and  L  bigger and bigger  until the diference between U and L is less than an accepted error margin M (or, in the best case, L  =  U, which is the square root of N).

So, the solution is to reverse the RATE equation from the PV pr FV and build your algorithm with the iteration approach.

Jose
0
 
LVL 31

Expert Comment

by:James Murrell
ID: 34424414
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question