IRR Function [VBA]

Calculates the internal rate of return for an investment.

Ikona ostrzeżenia

Ta funkcja lub stała jest włączona za pomocą instrukcji Opcja VBASupport 1 umieszczona przed kodem programu wykonywalnego w module.


Składnia:

IRR(Values() as Double , [Guess as Variant])

Zwracana wartość:

Double

Parametry:

Values(): The array of values of the cash-flow. The values represent cash flow values at regular intervals, at least one value must be negative (payments), and at least one value must be positive (income).

Guess Wstępne oszacowanie tego, jaka będzie stopa IRR.

Kody błędów:

5 Nieprawidłowe wywołanie procedury

Przykład:

REM ***** BASIC *****

Option VBASupport 1

Sub ExampleIRR

 Dim cashFlow(0 to 3) As Double

 cashFlow(0) = -10000

 cashFlow(1) = 3500

 cashFlow(2) = 7600

 cashFlow(3) = 1000

 irrValue = IRR(cashFlow) * 100

 Print irrValue ' zwraca 11,3321028236252. Wewnętrzna stopa zwrotu z przepływów pieniężnych.

End Sub