IRR Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Idelso Quintero

    IRR Problem

    Hi everyone:
    I am trying to use the IRR function that comes as part of the
    Financial Library in VB6, but it is returning some weird values.
    The case i am testing is fairly simple:

    initial investment = 100000
    withdrawals (at beginning of year) from 4 to 10 = 10000
    end Account Value = 599448

    The time spam is 226 months. So i am passing an array of size 227 (
    from 1 to 227) to the function with position 1 equal to -100000, then
    all other positions equal to zero (no transaction in those months)
    except positions 37,49,61,73,85, 97,109, which contain 10000
    (withdrawal amount) and last position 227 which contains the Account
    Value = 599448.
    When i run the function returns 0.
    I just discovered that if i make my time spam (collection size) equal
    to 50 and modify the collection accrodingly i would get a result
    greater than zero. So it seems there is a problem with arrays size
    greater than 50 and this function. Any idea how to go around the
    problem?

    Thanks a lot
  • Raoul Watson

    #2
    Re: IRR Problem


    "Idelso Quintero" <idelso.quinter [email protected] gard.com> wrote in message
    news:614ca41e.0 401210952.49f55 [email protected] gle.com...[color=blue]
    > Hi everyone:
    > I am trying to use the IRR function that comes as part of the
    > Financial Library in VB6, but it is returning some weird values.
    > The case i am testing is fairly simple:
    >
    > initial investment = 100000
    > withdrawals (at beginning of year) from 4 to 10 = 10000
    > end Account Value = 599448
    >
    > The time spam is 226 months. So i am passing an array of size 227 (
    > from 1 to 227) to the function with position 1 equal to -100000, then
    > all other positions equal to zero (no transaction in those months)
    > except positions 37,49,61,73,85, 97,109, which contain 10000
    > (withdrawal amount) and last position 227 which contains the Account
    > Value = 599448.
    > When i run the function returns 0.
    > I just discovered that if i make my time spam (collection size) equal
    > to 50 and modify the collection accrodingly i would get a result
    > greater than zero. So it seems there is a problem with arrays size
    > greater than 50 and this function. Any idea how to go around the
    > problem?
    >
    > Thanks a lot[/color]

    Check to ensure you dim doubles, i.e.
    Static Values(227) As Double ' Set up array.

    Make sure you have a non-zero for guess (i.e. 0.15) or something like that..

    Last.. why don't you post your code so we can see what we might be missing
    from your description.


    Comment

    Working...