|
-
Jan 15th, 2006, 12:49 PM
#1
Thread Starter
Addicted Member
Reverse Percentage Calculation
Hi Currently I am making a compounding calculator. Here is what I have and what I need to find out.
Say you get 190% of something after 20 times. Each time is compounded ontop of eachother. What I need to find out is how much % would you need to make 190% if you compounded. In this case it would be 3.2613218237364% compounded 20 times.
The code I use to find out what 3.2613218237364% is this
VB Code:
total = starting + (starting * percentage / 100)
For j = 2 To timescompounded
total = total + (total* percentage / 100)
Next j
So in this case it would be
VB Code:
total = 100 + (100 * 3.2613218237364 / 100)
For j = 2 To 20
total = total + (total* 3.2613218237364 / 100)
Next j
How can I find 3.2613218237364 If all I have is the total starting amount and times compounded?
Thank You
Robert AKA Messup000
-
Jan 15th, 2006, 07:27 PM
#2
Re: Reverse Percentage Calculation
You need to take the formula for compound interest and solve for the interest rate. The formula is:
Where FV is the future value, P is the principle, r is the interest rate (as a decimal) and n is the term. You want to solve for r given n and FV.
In your case, because you are using a percentage as the future value, you can substitute 1 for the principle, and the final percentage for the final value. In the example that you give, final value of 190% over 20 periods, this would plug into the equation like this:
Code:
1.9 = (1 + r) ^ 20
or
FV = (1 + r) ^ n
To solve for r, you would take the n'th root of both sides. You can calculate the n'th root by raising something to the power of the root's reciprocal. I.E. the 20th root of x is x raised to the 1/20. So the equations would now look like this:
Code:
1.9 ^ (1 / 20) = 1 + r
or
FV ^ (1 / n) = 1 + r
Finally, to solve for r you just subtract 1 from each side of the equation:
Code:
r = (1.9 ^ (1 / 20)) - 1
or
r = (FV ^ (1 / n)) - 1
You can easily make this into a VB function:
VB Code:
Private Sub TryIt()
Debug.Print ReverseCompound(1.9, 20)
End Sub
Private Function ReverseCompound(dFinalPercent As Double, iPeriod As Integer) As Double
ReverseCompound = (dFinalPercent ^ (1 / iPeriod)) - 1
End Function
Last edited by Comintern; Jan 15th, 2006 at 07:32 PM.
Reason: typo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|