contents.gifprev1.gifnext1.gif

IRRN() - Internal rate of return

Calculates the Internal Rate of Return of an investment based on a series of periodic cash flows and a discount rate. This function uses an iterative technique for calculating IRR that almost guarantees an result within the 500 tries with an accuracy of x%. This function lets you calculate the IRR at the precision level you need.

Returns

Double value if successful. If an error occurs, this function returns a zero.

Arguments

Type
Field
Description
double
dInitial
Initial investment
double
dInt
Guess interest percentage
double
dCF[]
Array of cash flows
integer
iCount
Number of cash flows in array
integer
iBasis
Value:
0 = end
1 = begin
integer
iPrecision
Number of precision decimals
16 bit DLL declarations

PowerBuilder Function declaration

function double IRRN(double dInitial, double dInt, double dCF[], int iCount, int iBasis, integer iPrecision) library "IFL16.DLL"

Visual Basic Function declaration

Declare Function IRRN lib "IFL16" (ByVal dInitial As Double, ByVal dInt As Double, ByRef dCF[] As Double, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

Access Function declaration

Declare Function IRRN lib "IFL16" (Byval dInitial As Double, ByVal dInt As Double, dCF As Any, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

C/C++ Synopsis

#include "function.h"

double IRRN(double dInitial, double dInt, double *dCF, int iCount, int iBasis, int iPrecision)

32 bit DLL declarations

PowerBuilder Function declaration

function double IRRN(double dInitial, double dInt, double dCF[], int iCount, int iBasis, integer iPrecision) library "IFL32.DLL"

Visual Basic Function declaration

Declare Function IRRN lib "IFL32" (ByVal dInitial As Double, ByVal dInt As Double, ByRef dCF[] As Double, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

Access Function declaration

Declare Function IRRN lib "IFL32" (Byval dInitial As Double, ByVal dInt As Double, dCF As Any, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

C/C++ Synopsis

#include "function.h"

double IRRN(double dInitial, double dInt, double *dCF, short sCount, short sBasis, short sPrecision)

Example:

dInitial
=
1,200

dInt
=
0.05
(5%)
dCF[1]
=
300

dCF[2]
=
-200

dCF[3]
=
500

dCF[4]
=
-150

dCF[5]
=
275

iCount
=
5

iBasis
=
0
(end of period)
iPrecision
=
5

Result: -0.14533 (-14.533%)