org.apache.poi.ss.formula.functions
Class Finance

java.lang.Object
  extended by org.apache.poi.ss.formula.functions.Finance

public class Finance
extends java.lang.Object

Implementation of the financial functions pmt, fv, ppmt, ipmt.


Constructor Summary
Finance()
           
 
Method Summary
static double fv(double r, int nper, double c, double pv)
          Overloaded fv() call omitting type, which defaults to 0.
static double fv(double r, int nper, double pmt, double pv, int type)
          Emulates Excel/Calc's FV(interest_rate, number_payments, payment, PV, Type) function, which calculates future value or principal at period N.
static double ipmt(double r, int per, int nper, double pv)
           
static double ipmt(double r, int per, int nper, double pv, double fv)
           
static double ipmt(double r, int per, int nper, double pv, double fv, int type)
          Emulates Excel/Calc's IPMT(interest_rate, period, number_payments, PV, FV, Type) function, which calculates the portion of the payment at a given period that is the interest on previous balance.
static double pmt(double r, int nper, double pv)
          Overloaded pmt() call omitting fv and type, which both default to 0.
static double pmt(double r, int nper, double pv, double fv)
          Overloaded pmt() call omitting type, which defaults to 0.
static double pmt(double r, int nper, double pv, double fv, int type)
          Emulates Excel/Calc's PMT(interest_rate, number_payments, PV, FV, Type) function, which calculates the payments for a loan or the future value of an investment
static double ppmt(double r, int per, int nper, double pv)
           
static double ppmt(double r, int per, int nper, double pv, double fv)
           
static double ppmt(double r, int per, int nper, double pv, double fv, int type)
          Emulates Excel/Calc's PPMT(interest_rate, period, number_payments, PV, FV, Type) function, which calculates the portion of the payment at a given period that will apply to principal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Finance

public Finance()
Method Detail

pmt

public static double pmt(double r,
                         int nper,
                         double pv,
                         double fv,
                         int type)
Emulates Excel/Calc's PMT(interest_rate, number_payments, PV, FV, Type) function, which calculates the payments for a loan or the future value of an investment

Parameters:
r - - periodic interest rate represented as a decimal.
nper - - number of total payments / periods.
pv - - present value -- borrowed or invested principal.
fv - - future value of loan or annuity.
type - - when payment is made: beginning of period is 1; end, 0.
Returns:
double representing periodic payment amount.

pmt

public static double pmt(double r,
                         int nper,
                         double pv,
                         double fv)
Overloaded pmt() call omitting type, which defaults to 0.

See Also:
pmt(double, int, double, double, int)

pmt

public static double pmt(double r,
                         int nper,
                         double pv)
Overloaded pmt() call omitting fv and type, which both default to 0.

See Also:
pmt(double, int, double, double, int)

ipmt

public static double ipmt(double r,
                          int per,
                          int nper,
                          double pv,
                          double fv,
                          int type)
Emulates Excel/Calc's IPMT(interest_rate, period, number_payments, PV, FV, Type) function, which calculates the portion of the payment at a given period that is the interest on previous balance.

Parameters:
r - - periodic interest rate represented as a decimal.
per - - period (payment number) to check value at.
nper - - number of total payments / periods.
pv - - present value -- borrowed or invested principal.
fv - - future value of loan or annuity.
type - - when payment is made: beginning of period is 1; end, 0.
Returns:
double representing interest portion of payment.
See Also:
pmt(double, int, double, double, int), fv(double, int, double, double, int)

ipmt

public static double ipmt(double r,
                          int per,
                          int nper,
                          double pv,
                          double fv)

ipmt

public static double ipmt(double r,
                          int per,
                          int nper,
                          double pv)

ppmt

public static double ppmt(double r,
                          int per,
                          int nper,
                          double pv,
                          double fv,
                          int type)
Emulates Excel/Calc's PPMT(interest_rate, period, number_payments, PV, FV, Type) function, which calculates the portion of the payment at a given period that will apply to principal.

Parameters:
r - - periodic interest rate represented as a decimal.
per - - period (payment number) to check value at.
nper - - number of total payments / periods.
pv - - present value -- borrowed or invested principal.
fv - - future value of loan or annuity.
type - - when payment is made: beginning of period is 1; end, 0.
Returns:
double representing principal portion of payment.
See Also:
pmt(double, int, double, double, int), ipmt(double, int, int, double, double, int)

ppmt

public static double ppmt(double r,
                          int per,
                          int nper,
                          double pv,
                          double fv)

ppmt

public static double ppmt(double r,
                          int per,
                          int nper,
                          double pv)

fv

public static double fv(double r,
                        int nper,
                        double pmt,
                        double pv,
                        int type)
Emulates Excel/Calc's FV(interest_rate, number_payments, payment, PV, Type) function, which calculates future value or principal at period N.

Parameters:
r - - periodic interest rate represented as a decimal.
nper - - number of total payments / periods.
pmt - - periodic payment amount.
pv - - present value -- borrowed or invested principal.
type - - when payment is made: beginning of period is 1; end, 0.
Returns:
double representing future principal value.

fv

public static double fv(double r,
                        int nper,
                        double c,
                        double pv)
Overloaded fv() call omitting type, which defaults to 0.

See Also:
fv(double, int, double, double, int)