Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bamah Cohen   on Nov 03 In MS Office Category.

  
Question Answered By: Freddie Evans   on Nov 03

I agree that there is something missing from the code that you pasted
in the message... it needs a 'next' tobe paired with the 'for'...

The first problem that I see is that you are testing the variable
RetRate in your 'do until' statement before the variable is
initialized or set to any value. The second problem is that
the 'Guess' you are sending the IRR function is the same each time
you call it. (Guess +.1) This structure guarantees that you will get
the same result during each pass through the loop.

But, looking at your code structure I think that your understanding
of the IRR function may be where the biggest problem lies. The
function returns a normalized floating number not a percent. So, if
your array of cash flows is within a 'normal range' you would expect
to have an internal rate of return under 200%. Your test is exiting
the loop  if the IRR is greater -1000%. I think what you meant to
test on is an IRR of -10%. So, most likely... your routine is
working but your testing limit is way too high. (also... even if
your array would yield a abs(IRR) greater than 1000% the numerical
approximation formula  used by Excel would probably fail and return
the wrong root.)

As an aside... your 'do loop' is trying to exit if it gets an IRR
above a certain value. If your aim here is to make sure that you are
returning an accurate result... this test is not a measure of
accuracy. A test of accuracy would be to put the rate returned by
the IRR function into the NPV function. A return value of zero means
that the IRR is good.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Loop in formula Or get search suggestion and latest updates.


Tagged: