PHPExcel_Calculation

# Class: PHPExcel_Calculation_Financial Source Location: /PHPExcel/Calculation/Financial.php
### Class Overview
PHPExcel_Calculation_Financial #### Author(s): #### Copyright: Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) | ### Methods ACCRINT ACCRINTM AMORDEGRC AMORLINC COUPDAYBS COUPDAYS COUPDAYSNC COUPNCD COUPNUM COUPPCD CUMIPMT CUMPRINC DB DDB DISC DOLLARDE DOLLARFR EFFECT FV FVSCHEDULE INTRATE IPMT IRR ISPMT MIRR NOMINAL NPER NPV PMT PPMT PRICE PRICEDISC PRICEMAT PV RATE RECEIVED SLN SYD TBILLEQ TBILLPRICE TBILLYIELD XIRR XNPV YIELDDISC YIELDMAT
### Class Details [line 53] PHPExcel_Calculation_Financial #### Tags:
copyright: | Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
[ Top ] ### Class Methods ### static method ACCRINT [line 155]
`static float ACCRINT( mixed $issue, mixed $firstinter, mixed $settlement, float $rate, [float $par = 1000], [int $frequency = 1], [ $basis = 0])`
ACCRINT Returns the discount rate for a security. #### Tags:
access: | public
#### Parameters:
mixed | $issue | issue The security's issue date.
mixed | $firstinter | firstinter The security's first interest date.
mixed | $settlement | settlement The security's settlement date.
float | $rate | rate The security's annual coupon rate.
float | $par | par The security's par value.
int | $frequency | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
| $basis |
[ Top ] ### static method ACCRINTM [line 198]
`static float ACCRINTM( mixed $issue, mixed $settlement, float $rate, [float $par = 1000], [int $basis = 0])`
ACCRINTM Returns the discount rate for a security. #### Tags:
access: | public
#### Parameters:
mixed | $issue | issue The security's issue date.
mixed | $settlement | settlement The security's settlement date.
float | $rate | rate The security's annual coupon rate.
float | $par | par The security's par value.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] ### static method AMORDEGRC [line 221]
`static void AMORDEGRC( $cost, $purchased, $firstPeriod, $salvage, $period, $rate, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $cost |
| $purchased |
| $firstPeriod |
| $salvage |
| $period |
| $rate |
| $basis |
[ Top ] ### static method AMORLINC [line 266]
`static void AMORLINC( $cost, $purchased, $firstPeriod, $salvage, $period, $rate, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $cost |
| $purchased |
| $firstPeriod |
| $salvage |
| $period |
| $rate |
| $basis |
[ Top ] ### static method COUPDAYBS [line 300]
`static void COUPDAYBS( $settlement, $maturity, $frequency, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $settlement |
| $maturity |
| $frequency |
| $basis |
[ Top ] ### static method COUPDAYS [line 326]
`static void COUPDAYS( $settlement, $maturity, $frequency, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $settlement |
| $maturity |
| $frequency |
| $basis |
[ Top ] ### static method COUPDAYSNC [line 364]
`static void COUPDAYSNC( $settlement, $maturity, $frequency, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $settlement |
| $maturity |
| $frequency |
| $basis |
[ Top ] ### static method COUPNCD [line 390]
`static void COUPNCD( $settlement, $maturity, $frequency, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $settlement |
| $maturity |
| $frequency |
| $basis |
[ Top ] ### static method COUPNUM [line 413]
`static void COUPNUM( $settlement, $maturity, $frequency, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $settlement |
| $maturity |
| $frequency |
| $basis |
[ Top ] ### static method COUPPCD [line 451]
`static void COUPPCD( $settlement, $maturity, $frequency, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $settlement |
| $maturity |
| $frequency |
| $basis |
[ Top ] ### static method CUMIPMT [line 488]
`static float CUMIPMT( float $rate, int $nper, float $pv, int $start, int $end, [int $type = 0])`
CUMIPMT Returns the cumulative interest paid on a loan between start_period and end_period. #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $nper | Number of periods
float | $pv | Present Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
int | $start | start The first period in the calculation. Payment periods are numbered beginning with 1.
int | $end | end The last period in the calculation.
[ Top ] ### static method CUMPRINC [line 528]
`static float CUMPRINC( float $rate, int $nper, float $pv, int $start, int $end, [int $type = 0])`
CUMPRINC Returns the cumulative principal paid on a loan between start_period and end_period. #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $nper | Number of periods
float | $pv | Present Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
int | $start | start The first period in the calculation. Payment periods are numbered beginning with 1.
int | $end | end The last period in the calculation.
[ Top ] ### static method DB [line 569]
`static float DB( float $cost, float $salvage, int $life, int $period, [float $month = 12])`
DB Returns the depreciation of an asset for a specified period using the fixed-declining balance method. This form of depreciation is used if you want to get a higher depreciation value at the beginning of the depreciation (as opposed to linear depreciation). The depreciation value is reduced with every depreciation period by the depreciation already deducted from the initial cost. #### Tags:
access: | public
#### Parameters:
float | $cost | cost Initial cost of the asset.
float | $salvage | salvage Value at the end of the depreciation. (Sometimes called the salvage value of the asset)
int | $life | life Number of periods over which the asset is depreciated. (Sometimes called the useful life of the asset)
int | $period | period The period for which you want to calculate the depreciation. Period must use the same units as life.
float | $month | month Number of months in the first year. If month is omitted, it defaults to 12.
[ Top ] ### static method DDB [line 621]
`static float DDB( float $cost, float $salvage, int $life, int $period, [float $factor = 2.0])`
DDB Returns the depreciation of an asset for a specified period using the double-declining balance method or some other method you specify. #### Tags:
access: | public
#### Parameters:
float | $cost | cost Initial cost of the asset.
float | $salvage | salvage Value at the end of the depreciation. (Sometimes called the salvage value of the asset)
int | $life | life Number of periods over which the asset is depreciated. (Sometimes called the useful life of the asset)
int | $period | period The period for which you want to calculate the depreciation. Period must use the same units as life.
float | $factor | factor The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).
[ Top ] ### static method DISC [line 671]
`static float DISC( mixed $settlement, mixed $maturity, int $price, int $redemption, [int $basis = 0])`
DISC Returns the discount rate for a security. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
mixed | $maturity | maturity The security's maturity date. The maturity date is the date when the security expires.
int | $price | price The security's price per $100 face value.
int | $redemption | redemption the security's redemption value per $100 face value.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] ### static method DOLLARDE [line 705]
`static float DOLLARDE( [float $fractional_dollar = Null], [int $fraction = 0])`
DOLLARDE Converts a dollar price expressed as an integer part and a fraction part into a dollar price expressed as a decimal number. Fractional dollar numbers are sometimes used for security prices. #### Tags:
access: | public
#### Parameters:
float | $fractional_dollar | Fractional Dollar
int | $fraction | Fraction
[ Top ] ### static method DOLLARFR [line 735]
`static float DOLLARFR( [float $decimal_dollar = Null], [int $fraction = 0])`
DOLLARFR Converts a dollar price expressed as a decimal number into a dollar price expressed as a fraction. Fractional dollar numbers are sometimes used for security prices. #### Tags:
access: | public
#### Parameters:
float | $decimal_dollar | Decimal Dollar
int | $fraction | Fraction
[ Top ] ### static method EFFECT [line 764]
`static float EFFECT( [float $nominal_rate = 0], [int $npery = 0])`
EFFECT Returns the effective interest rate given the nominal rate and the number of compounding payments per year. #### Tags:
access: | public
#### Parameters:
float | $nominal_rate | Nominal interest rate
int | $npery | Number of compounding payments per year
[ Top ] ### static method FV [line 789]
`static float FV( [float $rate = 0], [int $nper = 0], [float $pmt = 0], [float $pv = 0], [int $type = 0])`
FV Returns the Future Value of a cash flow with constant payments and interest rate (annuities). #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $nper | Number of periods
float | $pmt | Periodic payment (annuity)
float | $pv | Present Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
[ Top ] ### static method FVSCHEDULE [line 814]
`static void FVSCHEDULE( $principal, $schedule)`
FVSCHEDULE #### Tags:
access: | public
#### Parameters:
| $principal |
| $schedule |
[ Top ] ### static method INTRATE [line 845]
`static float INTRATE( mixed $settlement, mixed $maturity, int $investment, int $redemption, [int $basis = 0])`
INTRATE Returns the interest rate for a fully invested security. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
mixed | $maturity | maturity The security's maturity date. The maturity date is the date when the security expires.
int | $investment | investment The amount invested in the security.
int | $redemption | redemption The amount to be received at maturity.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] ### static method IPMT [line 882]
`static float IPMT( float $rate, int $per, int $nper, float $pv, [float $fv = 0], [int $type = 0])`
IPMT Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $per | Period for which we want to find the interest
int | $nper | Number of periods
float | $pv | Present Value
float | $fv | Future Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
[ Top ] ### static method IRR [line 904]
`static void IRR( $values, [ $guess = 0.1])`
#### Tags:
access: | public
#### Parameters:
| $values |
| $guess |
[ Top ] ### static method ISPMT [line 960]
`static void ISPMT( )`
ISPMT Returns the interest payment for an investment based on an interest rate and a constant payment schedule. Excel Function: =ISPMT(interest_rate, period, number_payments, PV) interest_rate is the interest rate for the investment period is the period to calculate the interest rate. It must be betweeen 1 and number_payments. number_payments is the number of payments for the annuity PV is the loan amount or present value of the payments #### Tags:
access: | public
[ Top ] ### static method MIRR [line 985]
`static void MIRR( $values, $finance_rate, $reinvestment_rate)`
#### Tags:
access: | public
#### Parameters:
| $values |
| $finance_rate |
| $reinvestment_rate |
[ Top ] ### static method NOMINAL [line 1024]
`static float NOMINAL( [float $effect_rate = 0], [int $npery = 0])`
NOMINAL Returns the nominal interest rate given the effective rate and the number of compounding payments per year. #### Tags:
access: | public
#### Parameters:
float | $effect_rate | Effective interest rate
int | $npery | Number of compounding payments per year
[ Top ] ### static method NPER [line 1050]
`static float NPER( [float $rate = 0], [int $pmt = 0], [float $pv = 0], [float $fv = 0], [int $type = 0])`
NPER Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate. #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $pmt | Periodic payment (annuity)
float | $pv | Present Value
float | $fv | Future Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
[ Top ] ### static method NPV [line 1086]
`static float NPV( float 0, array 1)`
NPV Returns the Net Present Value of a cash flow series given a discount rate. #### Tags:
access: | public
#### Parameters:
float | 0 | Discount interest rate
array | 1 | Cash flow series
[ Top ] ### static method PMT [line 1119]
`static float PMT( [float $rate = 0], [int $nper = 0], [float $pv = 0], [float $fv = 0], [int $type = 0])`
PMT Returns the constant payment (annuity) for a cash flow with a constant interest rate. #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $nper | Number of periods
float | $pv | Present Value
float | $fv | Future Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
[ Top ] ### static method PPMT [line 1153]
`static float PPMT( float $rate, int $per, int $nper, float $pv, [float $fv = 0], [int $type = 0])`
PPMT Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $per | Period for which we want to find the interest
int | $nper | Number of periods
float | $pv | Present Value
float | $fv | Future Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
[ Top ] ### static method PRICE [line 1175]
`static void PRICE( $settlement, $maturity, $rate, $yield, $redemption, $frequency, [ $basis = 0])`
#### Tags:
access: | public
#### Parameters:
| $settlement |
| $maturity |
| $rate |
| $yield |
| $redemption |
| $frequency |
| $basis |
[ Top ] ### static method PRICEDISC [line 1235]
`static float PRICEDISC( mixed $settlement, mixed $maturity, int $discount, int $redemption, [int $basis = 0])`
PRICEDISC Returns the price per $100 face value of a discounted security. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
mixed | $maturity | maturity The security's maturity date. The maturity date is the date when the security expires.
int | $discount | discount The security's discount rate.
int | $redemption | redemption The security's redemption value per $100 face value.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] ### static method PRICEMAT [line 1279]
`static float PRICEMAT( mixed $settlement, mixed $maturity, mixed $issue, int $rate, int $yield, [int $basis = 0])`
PRICEMAT Returns the price per $100 face value of a security that pays interest at maturity. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The security's settlement date. The security's settlement date is the date after the issue date when the security is traded to the buyer.
mixed | $maturity | maturity The security's maturity date. The maturity date is the date when the security expires.
mixed | $issue | issue The security's issue date.
int | $rate | rate The security's interest rate at date of issue.
int | $yield | yield The security's annual yield.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] ### static method PV [line 1335]
`static float PV( [float $rate = 0], [int $nper = 0], [float $pmt = 0], [float $fv = 0], [int $type = 0])`
PV Returns the Present Value of a cash flow with constant payments and interest rate (annuities). #### Tags:
access: | public
#### Parameters:
float | $rate | Interest rate per period
int | $nper | Number of periods
float | $pmt | Periodic payment (annuity)
float | $fv | Future Value
int | $type | Payment type: 0 = at the end of each period, 1 = at the beginning of each period
[ Top ] ### static method RATE [line 1360]
`static void RATE( $nper, $pmt, $pv, [ $fv = 0.0], [ $type = 0], [ $guess = 0.1])`
RATE #### Tags:
access: | public
#### Parameters:
| $nper |
| $pmt |
| $pv |
| $fv |
| $type |
| $guess |
[ Top ] ### static method RECEIVED [line 1420]
`static float RECEIVED( mixed $settlement, mixed $maturity, int $investment, int $discount, [int $basis = 0])`
RECEIVED Returns the price per $100 face value of a discounted security. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
mixed | $maturity | maturity The security's maturity date. The maturity date is the date when the security expires.
int | $investment | investment The amount invested in the security.
int | $discount | discount The security's discount rate.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] ### static method SLN [line 1454]
`static float SLN( cost $cost, salvage $salvage, life $life)`
SLN Returns the straight-line depreciation of an asset for one period #### Tags:
access: | public
#### Parameters:
cost | $cost | Initial cost of the asset
salvage | $salvage | Value at the end of the depreciation
life | $life | Number of periods over which the asset is depreciated
[ Top ] ### static method SYD [line 1481]
`static float SYD( cost $cost, salvage $salvage, life $life, period $period)`
SYD Returns the sum-of-years' digits depreciation of an asset for a specified period. #### Tags:
access: | public
#### Parameters:
cost | $cost | Initial cost of the asset
salvage | $salvage | Value at the end of the depreciation
life | $life | Number of periods over which the asset is depreciated
period | $period | Period
[ Top ] ### static method TBILLEQ [line 1510]
`static float TBILLEQ( mixed $settlement, mixed $maturity, int $discount)`
TBILLEQ Returns the bond-equivalent yield for a Treasury bill. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The Treasury bill's settlement date. The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
mixed | $maturity | maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.
int | $discount | discount The Treasury bill's discount rate.
[ Top ] ### static method TBILLPRICE [line 1548]
`static float TBILLPRICE( mixed $settlement, mixed $maturity, int $discount)`
TBILLPRICE Returns the yield for a Treasury bill. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The Treasury bill's settlement date. The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
mixed | $maturity | maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.
int | $discount | discount The Treasury bill's discount rate.
[ Top ] ### static method TBILLYIELD [line 1600]
`static float TBILLYIELD( mixed $settlement, mixed $maturity, int $price)`
TBILLYIELD Returns the yield for a Treasury bill. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The Treasury bill's settlement date. The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
mixed | $maturity | maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.
int | $price | price The Treasury bill's price per $100 face value.
[ Top ] ### static method XIRR [line 1632]
`static void XIRR( $values, $dates, [ $guess = 0.1])`
#### Tags:
access: | public
#### Parameters:
| $values |
| $dates |
| $guess |
[ Top ] ### static method XNPV [line 1688]
`static float XNPV( float $rate, array $values, array $dates)`
XNPV Returns the net present value for a schedule of cash flows that is not necessarily periodic. To calculate the net present value for a series of cash flows that is periodic, use the NPV function. Excel Function: =XNPV(rate,values,dates) #### Tags:
access: | public
#### Parameters:
float | $rate | The discount rate to apply to the cash flows.
array | $values | of float $values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.
array | $dates | of mixed $dates A schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order.
[ Top ] ### static method YIELDDISC [line 1726]
`static float YIELDDISC( mixed $settlement, mixed $maturity, int $price, int $redemption, [int $basis = 0])`
YIELDDISC Returns the annual yield of a security that pays interest at maturity. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The security's settlement date. The security's settlement date is the date after the issue date when the security is traded to the buyer.
mixed | $maturity | maturity The security's maturity date. The maturity date is the date when the security expires.
int | $price | price The security's price per $100 face value.
int | $redemption | redemption The security's redemption value per $100 face value.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] ### static method YIELDMAT [line 1775]
`static float YIELDMAT( mixed $settlement, mixed $maturity, mixed $issue, int $rate, int $price, [int $basis = 0])`
YIELDMAT Returns the annual yield of a security that pays interest at maturity. #### Tags:
access: | public
#### Parameters:
mixed | $settlement | settlement The security's settlement date. The security's settlement date is the date after the issue date when the security is traded to the buyer.
mixed | $maturity | maturity The security's maturity date. The maturity date is the date when the security expires.
mixed | $issue | issue The security's issue date.
int | $rate | rate The security's interest rate at date of issue.
int | $price | price The security's price per $100 face value.
int | $basis | basis The type of day count to use. or omitted US (NASD) 30/360 Actual/actual Actual/360 Actual/365 European 30/360
[ Top ] Documentation generated on Sun, 27 Feb 2011 16:31:38 -0800 by phpDocumentor 1.4.3