contents.gifprev1.gifnext1.gif

XIRRN() - Internal rate of return

Calculates the Internal Rate of Return of an investment based on a series of periodic cash flows and a series of irregular dates. 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
dCF[]
Series of cash flows
long
lDate[]
Series of dates
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 XIRRN(double dCF[], long lDate[], int iCount, int iBasis, integer iPrecision) library "IFL16.DLL"

Visual Basic Function declaration

Declare Function XIRRN lib "IFL16" (ByRef dCF[] As Double, ByRef lDate[] As Double, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

Access Function declaration

Declare Function XIRRN lib "IFL16" (dCF As Any, lDAte As Any, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

C/C++ Synopsis

#include "function.h"

double XIRRN(double *dCF, long *lDate, int iCount, int iBasis, int iPrecision)

32 bit DLL declarations

PowerBuilder Function declaration

function double XIRRN(double dCF[], long lDate[], int iCount, int iBasis, integer iPrecision) library "IFL32.DLL"

Visual Basic Function declaration

Declare Function XIRRN lib "IFL32" (ByRef dCF[] As Double, ByRef lDate[] As Double, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

Access Function declaration

Declare Function XIRRN lib "IFL32" (dCF As Any, lDate As Any, ByVal iCount As Integer, ByVal iBasis As Integer, ByVal iPrecision As Integer) As Double

C/C++ Synopsis

#include "function.h"

double XIRRN(double *dCF, long *lDate, short sCount, short sBasis, short sPrecision)

Example:

dCF[1]
=
-10000
Initial outflow
dCF[2]
=
2750

dCF[3]
=
4250

dCF[4]
=
3250

dCF[5]
=
2750

dDate[1]
=
33604
Initial date
dDate[2]
=
33664

dDate[3]
=
33907

dDate[4]
=
34015

dDate[5]
=
34060

dCount
=
5

dBasis
=
0
365 days
dPrecision
=
6

Result: 0.373363 (37.3363%)