Solved

Excel RATE() function algorithm

Posted on 2010-11-11
3
1,152 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
3 Comments
 
LVL 18

Accepted Solution

by:
JoseParrot 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Article by: Nadia
Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now