The IRR formula sometimes need Guess value in order to get IRR value.
The Guess value is a closer value to IRR value.
My macro can't do loop. This macro should find the Guess value from -10
to 10 with interval 0.1 and stops when the IRR value is available.
If cell B2, B2 B3 B4 and B5 contains -70000, 12000, 15000, 0 and 0
respectively. The result of IRR value should be -44.35% in cell B8. In
order to get -44.35%, I should put the Guess value example is -10%.
Below is my macro
Sub Macro1()
Dim Guess, RetRate
Static Values(5) As Double
Guess = -10
For Gues = -10 To 10
Values(0) = Range("B2").Value
Values(1) = Range("B3").Value:
Values(2) = Range("B4").Value
Values(3) = Range("B5").Value:
Values(4) = Range("B6").Value
Do Until RetRate >= -10
RetRate = IRR(Values(), Guess + 0.1)
Loop
Range("B8").Value = RetRate
End Sub
Can any body help ?