Solved

Excel RATE() function algorithm

Posted on 2010-11-11
3
1,184 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

830 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