Top Description Constructors Methods
org.apache.poi.ss.formula.functions

public final Class FinanceLib

extends Object
Class Inheritance

This class is a function library for common fiscal functions. Glossary of terms/abbreviations:
For more info on the terms/abbreviations please use the references below (hyperlinks are subject to change):

Online References:

  1. GNU Emacs Calc 2.02 Manual: http://theory.uwinnipeg.ca/gnu/calc/calc_203.html
  2. Yahoo Financial Glossary: http://biz.yahoo.com/f/g/nn.html#y
  3. MS Excel function reference: http://office.microsoft.com/en-us/assistance/CH062528251033.aspx
Implementation Notes:

Symbols used in the formulae that follow:

[From MS Excel function reference] Following are some of the key formulas that are used in this implementation:
p(1+r)^n + y(1+rt)((1+r)^n-1)/r + f=0   ...{when r!=0}
ny + p + f=0                            ...{when r=0}

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static double
fv(double
rate
r
,
double
num of periods
n
,
double
pmt per period
y
,
double
present value
p
,
boolean
type (true=pmt at beginning of period, false=pmt at end of period)
t
)

Future value of an amount given the number of payments, rate, amount of individual payment, present value and boolean value indicating whether payments are due at the beginning of period (false => payments are due at end of period)

public static double
nper(double
rate
r
,
double
pmt per period
y
,
double
present value
p
,
double
future value
f
,
boolean
type (true=pmt at beginning of period, false=pmt at end of period)
t
)

public static double
npv(double
rate
r
,
double[]
cashflow amounts
cfs
)

calculates the Net Present Value of a principal amount given the discount rate and a sequence of cash flows (supplied as an array).

public static double
pmt(double
rate
r
,
double
num of periods
n
,
double
present value
p
,
double
future value
f
,
boolean
type (true=pmt at beginning of period, false=pmt at end of period)
t
)

public static double
pv(double
rate
r
,
double
num of periods
n
,
double
pmt per period
y
,
double
future value
f
,
boolean
type (true=pmt at beginning of period, false=pmt at end of period)
t
)

Present value of an amount given the number of future payments, rate, amount of individual payment, future value and boolean value indicating whether payments are due at the beginning of period (false => payments are due at end of period)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FinanceLibback to summary
private FinanceLib()

Method Detail

fvback to summary
public static double fv(double r, double n, double y, double p, boolean t)

Future value of an amount given the number of payments, rate, amount of individual payment, present value and boolean value indicating whether payments are due at the beginning of period (false => payments are due at end of period)

Parameters
r:double

rate

n:double

num of periods

y:double

pmt per period

p:double

present value

t:boolean

type (true=pmt at beginning of period, false=pmt at end of period)

nperback to summary
public static double nper(double r, double y, double p, double f, boolean t)
Parameters
r:double

rate

y:double

pmt per period

p:double

present value

f:double

future value

t:boolean

type (true=pmt at beginning of period, false=pmt at end of period)

npvback to summary
public static double npv(double r, double[] cfs)

calculates the Net Present Value of a principal amount given the discount rate and a sequence of cash flows (supplied as an array). If the amounts are income the value should be positive, else if they are payments and not income, the value should be negative.

Parameters
r:double

rate

cfs:double[]

cashflow amounts

pmtback to summary
public static double pmt(double r, double n, double p, double f, boolean t)
Parameters
r:double

rate

n:double

num of periods

p:double

present value

f:double

future value

t:boolean

type (true=pmt at beginning of period, false=pmt at end of period)

pvback to summary
public static double pv(double r, double n, double y, double f, boolean t)

Present value of an amount given the number of future payments, rate, amount of individual payment, future value and boolean value indicating whether payments are due at the beginning of period (false => payments are due at end of period)

Parameters
r:double

rate

n:double

num of periods

y:double

pmt per period

f:double

future value

t:boolean

type (true=pmt at beginning of period, false=pmt at end of period)