Financial
Tags
Table of Contents
- FINANCIAL_MAX_ITERATIONS = 128
- FINANCIAL_PRECISION = 1.0E-8
- ACCRINT() : float|string
- ACCRINT.
- ACCRINTM() : float|string
- ACCRINTM.
- AMORDEGRC() : float|string
- AMORDEGRC.
- AMORLINC() : float|string
- AMORLINC.
- COUPDAYBS() : float|string
- COUPDAYBS.
- COUPDAYS() : float|string
- COUPDAYS.
- COUPDAYSNC() : float|string
- COUPDAYSNC.
- COUPNCD() : mixed
- COUPNCD.
- COUPNUM() : int|string
- COUPNUM.
- COUPPCD() : mixed
- COUPPCD.
- CUMIPMT() : float|string
- CUMIPMT.
- CUMPRINC() : float|string
- CUMPRINC.
- DB() : float|string
- DB.
- DDB() : float|string
- DDB.
- DISC() : float|string
- DISC.
- DOLLARDE() : array<string|int, mixed>|float|string
- DOLLARDE.
- DOLLARFR() : array<string|int, mixed>|float|string
- DOLLARFR.
- EFFECT() : float|string
- EFFECT.
- FV() : float|string
- FV.
- FVSCHEDULE() : float|string
- FVSCHEDULE.
- INTRATE() : float|string
- INTRATE.
- IPMT() : float|string
- IPMT.
- IRR() : float|string
- IRR.
- ISPMT() : float|string
- ISPMT.
- MIRR() : float|string
- MIRR.
- NOMINAL() : float|string
- NOMINAL.
- NPER() : float|string
- NPER.
- NPV() : float
- NPV.
- PDURATION() : float|string
- PDURATION.
- PMT() : float|string
- PMT.
- PPMT() : float|string
- PPMT.
- PRICE() : float|string
- PRICE.
- PRICEDISC() : float|string
- PRICEDISC.
- PRICEMAT() : float|string
- PRICEMAT.
- PV() : float|string
- PV.
- RATE() : float|string
- RATE.
- RECEIVED() : float|string
- RECEIVED.
- RRI() : float|string
- RRI.
- SLN() : float|string
- SLN.
- SYD() : float|string
- SYD.
- TBILLEQ() : float|string
- TBILLEQ.
- TBILLPRICE() : float|string
- TBILLPRICE.
- TBILLYIELD() : float|mixed|string
- TBILLYIELD.
- XIRR() : float|mixed|string
- XIRR.
- XNPV() : float|mixed|string
- XNPV.
- YIELDDISC() : float|string
- YIELDDISC.
- YIELDMAT() : float|string
- YIELDMAT.
Constants
FINANCIAL_MAX_ITERATIONS
public
mixed
FINANCIAL_MAX_ITERATIONS
= 128
FINANCIAL_PRECISION
public
mixed
FINANCIAL_PRECISION
= 1.0E-8
Methods
ACCRINT()
ACCRINT.
public
static ACCRINT(mixed $issue, mixed $firstInterest, mixed $settlement, mixed $rate[, mixed $parValue = 1000 ][, mixed $frequency = 1 ], mixed $basis[, mixed $calcMethod = true ]) : float|string
Returns the accrued interest for a security that pays periodic interest.
Excel Function: ACCRINT(issue,firstinterest,settlement,rate,par,frequency[,basis][,calc_method])
Parameters
- $issue : mixed
-
the security's issue date
- $firstInterest : mixed
-
the security's first interest date
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $rate : mixed
-
the security's annual coupon rate
- $parValue : mixed = 1000
-
The security's par value. If you omit par, ACCRINT uses $1,000.
- $frequency : mixed = 1
-
The number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : mixed
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
- $calcMethod : mixed = true
-
If true, use Issue to Settlement If false, use FirstInterest to Settlement
Tags
Return values
float|string —Result, or a string containing an error
ACCRINTM()
ACCRINTM.
public
static ACCRINTM(mixed $issue, mixed $settlement, mixed $rate[, mixed $parValue = 1000 ], mixed $basis) : float|string
Returns the accrued interest for a security that pays interest at maturity.
Excel Function: ACCRINTM(issue,settlement,rate[,par[,basis]])
Parameters
- $issue : mixed
-
The security's issue date
- $settlement : mixed
-
The security's settlement (or maturity) date
- $rate : mixed
-
The security's annual coupon rate
- $parValue : mixed = 1000
-
The security's par value. If you omit par, ACCRINT uses $1,000.
- $basis : mixed
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —Result, or a string containing an error
AMORDEGRC()
AMORDEGRC.
public
static AMORDEGRC(float $cost, mixed $purchased, mixed $firstPeriod, mixed $salvage, float $period, float $rate, int $basis) : float|string
Returns the depreciation for each accounting period. This function is provided for the French accounting system. If an asset is purchased in the middle of the accounting period, the prorated depreciation is taken into account. The function is similar to AMORLINC, except that a depreciation coefficient is applied in the calculation depending on the life of the assets. This function will return the depreciation until the last period of the life of the assets or until the cumulated value of depreciation is greater than the cost of the assets minus the salvage value.
Excel Function: AMORDEGRC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
Parameters
- $cost : float
-
The cost of the asset
- $purchased : mixed
-
Date of the purchase of the asset
- $firstPeriod : mixed
-
Date of the end of the first period
- $salvage : mixed
-
The salvage value at the end of the life of the asset
- $period : float
-
The period
- $rate : float
-
Rate of depreciation
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —(string containing the error type if there is an error)
AMORLINC()
AMORLINC.
public
static AMORLINC(float $cost, mixed $purchased, mixed $firstPeriod, mixed $salvage, float $period, float $rate, int $basis) : float|string
Returns the depreciation for each accounting period. This function is provided for the French accounting system. If an asset is purchased in the middle of the accounting period, the prorated depreciation is taken into account.
Excel Function: AMORLINC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
Parameters
- $cost : float
-
The cost of the asset
- $purchased : mixed
-
Date of the purchase of the asset
- $firstPeriod : mixed
-
Date of the end of the first period
- $salvage : mixed
-
The salvage value at the end of the life of the asset
- $period : float
-
The period
- $rate : float
-
Rate of depreciation
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —(string containing the error type if there is an error)
COUPDAYBS()
COUPDAYBS.
public
static COUPDAYBS(mixed $settlement, mixed $maturity, int $frequency, int $basis) : float|string
Returns the number of days from the beginning of the coupon period to the settlement date.
Excel Function: COUPDAYBS(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : int
-
the number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —COUPDAYS()
COUPDAYS.
public
static COUPDAYS(mixed $settlement, mixed $maturity, mixed $frequency, int $basis) : float|string
Returns the number of days in the coupon period that contains the settlement date.
Excel Function: COUPDAYS(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
the number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —COUPDAYSNC()
COUPDAYSNC.
public
static COUPDAYSNC(mixed $settlement, mixed $maturity, mixed $frequency, int $basis) : float|string
Returns the number of days from the settlement date to the next coupon date.
Excel Function: COUPDAYSNC(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
the number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —COUPNCD()
COUPNCD.
public
static COUPNCD(mixed $settlement, mixed $maturity, mixed $frequency, int $basis) : mixed
Returns the next coupon date after the settlement date.
Excel Function: COUPNCD(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
the number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
mixed —Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
COUPNUM()
COUPNUM.
public
static COUPNUM(mixed $settlement, mixed $maturity, mixed $frequency, int $basis) : int|string
Returns the number of coupons payable between the settlement date and maturity date, rounded up to the nearest whole coupon.
Excel Function: COUPNUM(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
the number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
int|string —COUPPCD()
COUPPCD.
public
static COUPPCD(mixed $settlement, mixed $maturity, mixed $frequency, int $basis) : mixed
Returns the previous coupon date before the settlement date.
Excel Function: COUPPCD(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
the number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
mixed —Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
CUMIPMT()
CUMIPMT.
public
static CUMIPMT(float $rate, int $nper, float $pv, int $start, int $end, int $type) : float|string
Returns the cumulative interest paid on a loan between the start and end periods.
Excel Function: CUMIPMT(rate,nper,pv,start,end[,type])
Parameters
- $rate : float
-
The Interest rate
- $nper : int
-
The total number of payment periods
- $pv : float
-
Present Value
- $start : int
-
The first period in the calculation. Payment periods are numbered beginning with 1.
- $end : int
-
the last period in the calculation
- $type : int
-
A number 0 or 1 and indicates when payments are due: 0 or omitted At the end of the period. 1 At the beginning of the period.
Tags
Return values
float|string —CUMPRINC()
CUMPRINC.
public
static CUMPRINC(float $rate, int $nper, float $pv, int $start, int $end, int $type) : float|string
Returns the cumulative principal paid on a loan between the start and end periods.
Excel Function: CUMPRINC(rate,nper,pv,start,end[,type])
Parameters
- $rate : float
-
The Interest rate
- $nper : int
-
The total number of payment periods
- $pv : float
-
Present Value
- $start : int
-
The first period in the calculation. Payment periods are numbered beginning with 1.
- $end : int
-
the last period in the calculation
- $type : int
-
A number 0 or 1 and indicates when payments are due: 0 or omitted At the end of the period. 1 At the beginning of the period.
Tags
Return values
float|string —DB()
DB.
public
static DB(float $cost, float $salvage, int $life, int $period[, int $month = 12 ]) : float|string
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.
Excel Function: DB(cost,salvage,life,period[,month])
Parameters
- $cost : float
-
Initial cost of the asset
- $salvage : float
-
Value at the end of the depreciation. (Sometimes called the salvage value of the asset)
- $life : int
-
Number of periods over which the asset is depreciated. (Sometimes called the useful life of the asset)
- $period : int
-
The period for which you want to calculate the depreciation. Period must use the same units as life.
- $month : int = 12
-
Number of months in the first year. If month is omitted, it defaults to 12.
Tags
Return values
float|string —DDB()
DDB.
public
static DDB(float $cost, float $salvage, int $life, int $period[, float $factor = 2.0 ]) : float|string
Returns the depreciation of an asset for a specified period using the double-declining balance method or some other method you specify.
Excel Function: DDB(cost,salvage,life,period[,factor])
Parameters
- $cost : float
-
Initial cost of the asset
- $salvage : float
-
Value at the end of the depreciation. (Sometimes called the salvage value of the asset)
- $life : int
-
Number of periods over which the asset is depreciated. (Sometimes called the useful life of the asset)
- $period : int
-
The period for which you want to calculate the depreciation. Period must use the same units as life.
- $factor : float = 2.0
-
The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).
Tags
Return values
float|string —DISC()
DISC.
public
static DISC(mixed $settlement, mixed $maturity, mixed $price, int $redemption, int $basis) : float|string
Returns the discount rate for a security.
Excel Function: DISC(settlement,maturity,price,redemption[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $price : mixed
-
The security's price per $100 face value
- $redemption : int
-
The security's redemption value per $100 face value
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —DOLLARDE()
DOLLARDE.
public
static DOLLARDE([array<string|int, mixed>|float $fractional_dollar = null ], array<string|int, mixed>|int $fraction) : array<string|int, mixed>|float|string
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.
Excel Function: DOLLARDE(fractional_dollar,fraction)
Parameters
- $fractional_dollar : array<string|int, mixed>|float = null
-
Fractional Dollar
- $fraction : array<string|int, mixed>|int
-
Fraction
Tags
Return values
array<string|int, mixed>|float|string —DOLLARFR()
DOLLARFR.
public
static DOLLARFR([array<string|int, mixed>|float $decimal_dollar = null ], array<string|int, mixed>|int $fraction) : array<string|int, mixed>|float|string
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.
Excel Function: DOLLARFR(decimal_dollar,fraction)
Parameters
- $decimal_dollar : array<string|int, mixed>|float = null
-
Decimal Dollar
- $fraction : array<string|int, mixed>|int
-
Fraction
Tags
Return values
array<string|int, mixed>|float|string —EFFECT()
EFFECT.
public
static EFFECT(float $nominalRate, int $periodsPerYear) : float|string
Returns the effective interest rate given the nominal rate and the number of compounding payments per year.
Excel Function: EFFECT(nominal_rate,npery)
Parameters
- $nominalRate : float
-
Nominal interest rate
- $periodsPerYear : int
-
Number of compounding payments per year
Tags
Return values
float|string —FV()
FV.
public
static FV(float $rate, int $nper, float $pmt, float $pv, int $type) : float|string
Returns the Future Value of a cash flow with constant payments and interest rate (annuities).
Excel Function: FV(rate,nper,pmt[,pv[,type]])
Parameters
- $rate : float
-
The interest rate per period
- $nper : int
-
Total number of payment periods in an annuity
- $pmt : float
-
The payment made each period: it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.
- $pv : float
-
present Value, or the lump-sum amount that a series of future payments is worth right now
- $type : int
-
A number 0 or 1 and indicates when payments are due: 0 or omitted At the end of the period. 1 At the beginning of the period.
Tags
Return values
float|string —FVSCHEDULE()
FVSCHEDULE.
public
static FVSCHEDULE(float $principal, array<string|int, float> $schedule) : float|string
Returns the future value of an initial principal after applying a series of compound interest rates. Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.
Excel Function: FVSCHEDULE(principal,schedule)
Parameters
- $principal : float
-
the present value
- $schedule : array<string|int, float>
-
an array of interest rates to apply
Tags
Return values
float|string —INTRATE()
INTRATE.
public
static INTRATE(mixed $settlement, mixed $maturity, int $investment, int $redemption, int $basis) : float|string
Returns the interest rate for a fully invested security.
Excel Function: INTRATE(settlement,maturity,investment,redemption[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $investment : int
-
the amount invested in the security
- $redemption : int
-
the amount to be received at maturity
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —IPMT()
IPMT.
public
static IPMT(float $rate, int $per, int $nper, float $pv, float $fv, int $type) : float|string
Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
Excel Function: IPMT(rate,per,nper,pv[,fv][,type])
Parameters
- $rate : float
-
Interest rate per period
- $per : int
-
Period for which we want to find the interest
- $nper : int
-
Number of periods
- $pv : float
-
Present Value
- $fv : float
-
Future Value
- $type : int
-
Payment type: 0 = at the end of each period, 1 = at the beginning of each period
Tags
Return values
float|string —IRR()
IRR.
public
static IRR(mixed $values[, mixed $guess = 0.1 ]) : float|string
Returns the internal rate of return for a series of cash flows represented by the numbers in values. These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received for an investment consisting of payments (negative values) and income (positive values) that occur at regular periods.
Excel Function: IRR(values[,guess])
Parameters
- $values : mixed
-
An array or a reference to cells that contain numbers for which you want to calculate the internal rate of return. Values must contain at least one positive value and one negative value to calculate the internal rate of return.
- $guess : mixed = 0.1
-
A number that you guess is close to the result of IRR
Tags
Return values
float|string —ISPMT()
ISPMT.
public
static ISPMT(array<string|int, mixed> ...$args) : float|string
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)
Parameters
- $args : array<string|int, mixed>
Tags
Return values
float|string —MIRR()
MIRR.
public
static MIRR(mixed $values, mixed $finance_rate, mixed $reinvestment_rate) : float|string
Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both the cost of the investment and the interest received on reinvestment of cash.
Excel Function: MIRR(values,finance_rate, reinvestment_rate)
Parameters
- $values : mixed
-
An array or a reference to cells that contain a series of payments and income occurring at regular intervals. Payments are negative value, income is positive values.
- $finance_rate : mixed
-
The interest rate you pay on the money used in the cash flows
- $reinvestment_rate : mixed
-
The interest rate you receive on the cash flows as you reinvest them
Tags
Return values
float|string —Result, or a string containing an error
NOMINAL()
NOMINAL.
public
static NOMINAL(float $effectiveRate, int $periodsPerYear) : float|string
Returns the nominal interest rate given the effective rate and the number of compounding payments per year.
Excel Function: NOMINAL(effect_rate, npery)
Parameters
- $effectiveRate : float
-
Effective interest rate
- $periodsPerYear : int
-
Number of compounding payments per year
Tags
Return values
float|string —Result, or a string containing an error
NPER()
NPER.
public
static NPER(float $rate, int $pmt, float $pv, float $fv, int $type) : float|string
Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.
Parameters
- $rate : float
-
Interest rate per period
- $pmt : int
-
Periodic payment (annuity)
- $pv : float
-
Present Value
- $fv : float
-
Future Value
- $type : int
-
Payment type: 0 = at the end of each period, 1 = at the beginning of each period
Tags
Return values
float|string —Result, or a string containing an error
NPV()
NPV.
public
static NPV(array<string|int, mixed> ...$args) : float
Returns the Net Present Value of a cash flow series given a discount rate.
Parameters
- $args : array<string|int, mixed>
Tags
Return values
float —PDURATION()
PDURATION.
public
static PDURATION(float $rate, float $pv, float $fv) : float|string
Calculates the number of periods required for an investment to reach a specified value.
Parameters
- $rate : float
-
Interest rate per period
- $pv : float
-
Present Value
- $fv : float
-
Future Value
Tags
Return values
float|string —Result, or a string containing an error
PMT()
PMT.
public
static PMT(float $rate, int $nper, float $pv, float $fv, int $type) : float|string
Returns the constant payment (annuity) for a cash flow with a constant interest rate.
Parameters
- $rate : float
-
Interest rate per period
- $nper : int
-
Number of periods
- $pv : float
-
Present Value
- $fv : float
-
Future Value
- $type : int
-
Payment type: 0 = at the end of each period, 1 = at the beginning of each period
Tags
Return values
float|string —Result, or a string containing an error
PPMT()
PPMT.
public
static PPMT(float $rate, int $per, int $nper, float $pv, float $fv, int $type) : float|string
Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
Parameters
- $rate : float
-
Interest rate per period
- $per : int
-
Period for which we want to find the interest
- $nper : int
-
Number of periods
- $pv : float
-
Present Value
- $fv : float
-
Future Value
- $type : int
-
Payment type: 0 = at the end of each period, 1 = at the beginning of each period
Tags
Return values
float|string —Result, or a string containing an error
PRICE()
PRICE.
public
static PRICE(mixed $settlement, mixed $maturity, float $rate, float $yield, float $redemption, int $frequency, int $basis) : float|string
Returns the price per $100 face value of a security that pays periodic interest.
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $rate : float
-
the security's annual coupon rate
- $yield : float
-
the security's annual yield
- $redemption : float
-
The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.
- $frequency : int
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —Result, or a string containing an error
PRICEDISC()
PRICEDISC.
public
static PRICEDISC(mixed $settlement, mixed $maturity, mixed $discount, int $redemption, int $basis) : float|string
Returns the price per $100 face value of a discounted security.
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $discount : mixed
-
The security's discount rate
- $redemption : int
-
The security's redemption value per $100 face value
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —Result, or a string containing an error
PRICEMAT()
PRICEMAT.
public
static PRICEMAT(mixed $settlement, mixed $maturity, mixed $issue, mixed $rate, mixed $yield, int $basis) : float|string
Returns the price per $100 face value of a security that pays interest at maturity.
Parameters
- $settlement : mixed
-
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.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $issue : mixed
-
The security's issue date
- $rate : mixed
-
The security's interest rate at date of issue
- $yield : mixed
-
The security's annual yield
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —Result, or a string containing an error
PV()
PV.
public
static PV(float $rate, int $nper, float $pmt, float $fv, int $type) : float|string
Returns the Present Value of a cash flow with constant payments and interest rate (annuities).
Parameters
- $rate : float
-
Interest rate per period
- $nper : int
-
Number of periods
- $pmt : float
-
Periodic payment (annuity)
- $fv : float
-
Future Value
- $type : int
-
Payment type: 0 = at the end of each period, 1 = at the beginning of each period
Tags
Return values
float|string —Result, or a string containing an error
RATE()
RATE.
public
static RATE(mixed $nper, mixed $pmt, mixed $pv[, mixed $fv = 0.0 ], mixed $type[, mixed $guess = 0.1 ]) : float|string
Returns the interest rate per period of an annuity. RATE is calculated by iteration and can have zero or more solutions. If the successive results of RATE do not converge to within 0.0000001 after 20 iterations, RATE returns the #NUM! error value.
Excel Function: RATE(nper,pmt,pv[,fv[,type[,guess]]])
Parameters
- $nper : mixed
-
The total number of payment periods in an annuity
- $pmt : mixed
-
The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes.
- $pv : mixed
-
The present value - the total amount that a series of future payments is worth now
- $fv : mixed = 0.0
-
The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).
- $type : mixed
-
A number 0 or 1 and indicates when payments are due: 0 or omitted At the end of the period. 1 At the beginning of the period.
- $guess : mixed = 0.1
-
Your guess for what the rate will be. If you omit guess, it is assumed to be 10 percent.
Tags
Return values
float|string —RECEIVED()
RECEIVED.
public
static RECEIVED(mixed $settlement, mixed $maturity, mixed $investment, mixed $discount, mixed $basis) : float|string
Returns the amount received at maturity for a fully invested Security.
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $investment : mixed
-
The amount invested in the security
- $discount : mixed
-
The security's discount rate
- $basis : mixed
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —Result, or a string containing an error
RRI()
RRI.
public
static RRI(float $nper, float $pv, float $fv) : float|string
Calculates the interest rate required for an investment to grow to a specified future value .
Parameters
- $nper : float
-
The number of periods over which the investment is made
- $pv : float
-
Present Value
- $fv : float
-
Future Value
Tags
Return values
float|string —Result, or a string containing an error
SLN()
SLN.
public
static SLN(mixed $cost, mixed $salvage, mixed $life) : float|string
Returns the straight-line depreciation of an asset for one period
Parameters
- $cost : mixed
-
Initial cost of the asset
- $salvage : mixed
-
Value at the end of the depreciation
- $life : mixed
-
Number of periods over which the asset is depreciated
Tags
Return values
float|string —Result, or a string containing an error
SYD()
SYD.
public
static SYD(mixed $cost, mixed $salvage, mixed $life, mixed $period) : float|string
Returns the sum-of-years' digits depreciation of an asset for a specified period.
Parameters
- $cost : mixed
-
Initial cost of the asset
- $salvage : mixed
-
Value at the end of the depreciation
- $life : mixed
-
Number of periods over which the asset is depreciated
- $period : mixed
-
Period
Tags
Return values
float|string —Result, or a string containing an error
TBILLEQ()
TBILLEQ.
public
static TBILLEQ(mixed $settlement, mixed $maturity, mixed $discount) : float|string
Returns the bond-equivalent yield for a Treasury bill.
Parameters
- $settlement : mixed
-
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.
- $maturity : mixed
-
The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.
- $discount : mixed
-
The Treasury bill's discount rate
Tags
Return values
float|string —Result, or a string containing an error
TBILLPRICE()
TBILLPRICE.
public
static TBILLPRICE(mixed $settlement, mixed $maturity, mixed $discount) : float|string
Returns the price per $100 face value for a Treasury bill.
Parameters
- $settlement : mixed
-
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.
- $maturity : mixed
-
The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.
- $discount : mixed
-
The Treasury bill's discount rate
Tags
Return values
float|string —Result, or a string containing an error
TBILLYIELD()
TBILLYIELD.
public
static TBILLYIELD(mixed $settlement, mixed $maturity, mixed $price) : float|mixed|string
Returns the yield for a Treasury bill.
Parameters
- $settlement : mixed
-
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.
- $maturity : mixed
-
The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.
- $price : mixed
-
The Treasury bill's price per $100 face value
Tags
Return values
float|mixed|string —XIRR()
XIRR.
public
static XIRR(array<string|int, float> $values, array<string|int, mixed> $dates[, float $guess = 0.1 ]) : float|mixed|string
Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.
Excel Function: =XIRR(values,dates,guess)
Parameters
- $values : array<string|int, float>
-
A series of cash flow payments The series of values must contain at least one positive value & one negative value
- $dates : array<string|int, mixed>
-
A series of payment dates 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
- $guess : float = 0.1
-
An optional guess at the expected answer
Tags
Return values
float|mixed|string —XNPV()
XNPV.
public
static XNPV(float $rate, array<string|int, float> $values, array<string|int, mixed> $dates) : float|mixed|string
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)
Parameters
- $rate : float
-
the discount rate to apply to the cash flows
- $values : array<string|int, float>
-
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.
- $dates : array<string|int, mixed>
-
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.
Tags
Return values
float|mixed|string —YIELDDISC()
YIELDDISC.
public
static YIELDDISC(mixed $settlement, mixed $maturity, mixed $price, int $redemption, int $basis) : float|string
Returns the annual yield of a security that pays interest at maturity.
Parameters
- $settlement : mixed
-
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.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $price : mixed
-
The security's price per $100 face value
- $redemption : int
-
The security's redemption value per $100 face value
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —Result, or a string containing an error
YIELDMAT()
YIELDMAT.
public
static YIELDMAT(mixed $settlement, mixed $maturity, mixed $issue, mixed $rate, mixed $price, int $basis) : float|string
Returns the annual yield of a security that pays interest at maturity.
Parameters
- $settlement : mixed
-
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.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $issue : mixed
-
The security's issue date
- $rate : mixed
-
The security's interest rate at date of issue
- $price : mixed
-
The security's price per $100 face value
- $basis : int
-
The type of day count to use. 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Tags
Return values
float|string —Result, or a string containing an error