Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel RATE() function algorithm

Posted on 2010-11-11
3
Medium Priority
?
1,276 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 2000 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

Technology Partners: 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

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…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

610 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