Solved

Excel RATE() function algorithm

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

867 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

15 Experts available now in Live!

Get 1:1 Help Now