@sheetxl/formulas-extended 0.8.0-beta.1 → 0.8.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/B4ANcw0mAmhe2Aeb.cjs +1 -0
- package/browser/cjs/B6IXpae7f0J8Ocq6.cjs +1 -0
- package/browser/cjs/Bncc0oXhFMdj_HuR.cjs +1 -0
- package/browser/cjs/C4cZxb9nRtzTCA40.cjs +1 -0
- package/browser/cjs/{lEQC21-Sk4lwHy2r.cjs → CFxueP0tbpmvY1Ip.cjs} +1 -1
- package/browser/cjs/CRcv32tHTbGSGtkh.cjs +1 -0
- package/browser/cjs/CaJGoNwTL6pAJ6a4.cjs +1 -0
- package/browser/cjs/CfXcRa4RlFmqU0Op.cjs +1 -0
- package/browser/cjs/{CnZfa45XxA-9Jhmp.cjs → DRmo6uoGoqtiVff8.cjs} +1 -1
- package/browser/cjs/DSXLVieENYN9qXYl.cjs +1 -0
- package/browser/cjs/DpFg69dDCPoOK2BY.cjs +1 -0
- package/browser/cjs/PmwvZPFhqmL4DO58.cjs +1 -0
- package/browser/cjs/SATfdSwNygvlOSKC.cjs +1 -0
- package/browser/cjs/XRCcogT-Iqd3Wv6R.cjs +1 -0
- package/browser/cjs/iYn00uzmSLl2T0oN.cjs +1 -0
- package/browser/cjs/index.cjs +1 -1
- package/browser/esm/6amJZ6Ci7khs1EpQ.mjs +37 -0
- package/{node/esm/vu0NRDeeTbEHPMYS.mjs → browser/esm/B8VR_ZAEMWJqOVFM.mjs} +2 -2
- package/{node/esm/Bma3CN4_Nec6_4n7.mjs → browser/esm/BGCEjkOTEskgvBSD.mjs} +6 -6
- package/{node/esm/DodhOXkSzelSxHmB.mjs → browser/esm/Bm9n_7JWXmhQ_BAb.mjs} +27 -29
- package/browser/esm/{DpoZ7h1ScIJvbOY9.mjs → BtNf1hXsR3TvolZ6.mjs} +5 -5
- package/{node/esm/COqdI1LYTHd9oLA6.mjs → browser/esm/BwmPpdf2z0FDv9IZ.mjs} +1 -1
- package/{node/esm/srpVt74r2zbvm1N0.mjs → browser/esm/C0mSYrr2yF012bGD.mjs} +5 -5
- package/browser/esm/{B1VmvhXuEn7zaTB9.mjs → C4vFDf_lYH0QSaE1.mjs} +1 -1
- package/browser/esm/{DY3kG36QGyDbrANO.mjs → CU2EkdawYacXSt1c.mjs} +1 -1
- package/browser/esm/{BFnDPCjxJcoIItFa.mjs → CugijEQsjGn9ENYE.mjs} +3 -3
- package/browser/esm/Cwb0ysaCuxSO5Wp7.mjs +58 -0
- package/browser/esm/D5wiSKIeUtCkBDf7.mjs +33 -0
- package/browser/esm/DKiPLYQWGk-Ov6wa.mjs +47 -0
- package/browser/esm/Da8bWIg7O-5vDAog.mjs +32 -0
- package/browser/esm/DdQaTbz0VTi-8RUW.mjs +32 -0
- package/{node/esm/CnVJ8GAsshRjRGA-.mjs → browser/esm/Dlpw5YQAcTl-Cfrt.mjs} +2 -2
- package/browser/esm/Dq6rGM4iP0zy52lg.mjs +19 -0
- package/{node/esm/BuGemmv84T8m0wqw.mjs → browser/esm/Sd9LvsDzMdOmTsXR.mjs} +1 -1
- package/browser/esm/WET3PcaveNwVooXd.mjs +119 -0
- package/{node/esm/BRwwvGaJ6HvkxjFC.mjs → browser/esm/cNTNUggnKXPO1Ebs.mjs} +1 -1
- package/browser/esm/index.mjs +3283 -1677
- package/node/esm/6amJZ6Ci7khs1EpQ.mjs +37 -0
- package/{browser/esm/vu0NRDeeTbEHPMYS.mjs → node/esm/B8VR_ZAEMWJqOVFM.mjs} +2 -2
- package/{browser/esm/Bma3CN4_Nec6_4n7.mjs → node/esm/BGCEjkOTEskgvBSD.mjs} +6 -6
- package/{browser/esm/DodhOXkSzelSxHmB.mjs → node/esm/Bm9n_7JWXmhQ_BAb.mjs} +27 -29
- package/node/esm/{DpoZ7h1ScIJvbOY9.mjs → BtNf1hXsR3TvolZ6.mjs} +5 -5
- package/{browser/esm/COqdI1LYTHd9oLA6.mjs → node/esm/BwmPpdf2z0FDv9IZ.mjs} +1 -1
- package/{browser/esm/srpVt74r2zbvm1N0.mjs → node/esm/C0mSYrr2yF012bGD.mjs} +5 -5
- package/node/esm/{B1VmvhXuEn7zaTB9.mjs → C4vFDf_lYH0QSaE1.mjs} +1 -1
- package/node/esm/Cwb0ysaCuxSO5Wp7.mjs +58 -0
- package/node/esm/D5wiSKIeUtCkBDf7.mjs +33 -0
- package/node/esm/DKiPLYQWGk-Ov6wa.mjs +47 -0
- package/node/esm/Da8bWIg7O-5vDAog.mjs +32 -0
- package/node/esm/DdQaTbz0VTi-8RUW.mjs +32 -0
- package/node/esm/{LAkTk93odAfpvx50.mjs → Di8nKpCkAReXfW0y.mjs} +1 -1
- package/{browser/esm/CnVJ8GAsshRjRGA-.mjs → node/esm/Dlpw5YQAcTl-Cfrt.mjs} +2 -2
- package/node/esm/{BQyZVLTMNFLbjVap.mjs → DndwLLj7OgAwCNqT.mjs} +3 -3
- package/{browser/esm/BuGemmv84T8m0wqw.mjs → node/esm/Sd9LvsDzMdOmTsXR.mjs} +1 -1
- package/node/esm/WET3PcaveNwVooXd.mjs +119 -0
- package/node/esm/bC-_uC9o3MGBu2fU.mjs +19 -0
- package/{browser/esm/BRwwvGaJ6HvkxjFC.mjs → node/esm/cNTNUggnKXPO1Ebs.mjs} +1 -1
- package/node/esm/index.mjs +3607 -1998
- package/package.json +3 -3
- package/types/src/.generated/decl/financial/Annuity.decl.d.ts +5 -0
- package/types/src/.generated/decl/financial/{Financial.decl.d.ts → Cashflow.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Convert.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Coupon.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{Financial2.decl.d.ts → Depreciation.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Growth.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{ODD.decl.d.ts → Odd.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/{Financial3.decl.d.ts → STOCKHISTORY.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Security.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{Financial4.decl.d.ts → SecurityMaturity.decl.d.ts} +1 -1
- package/types/src/.generated/decl/{statistical/TTEST.decl.d.ts → financial/TBill.decl.d.ts} +1 -1
- package/types/src/.generated/decl/statistical/{ETS.decl.d.ts → Ets.decl.d.ts} +1 -1
- package/types/src/.generated/decl/statistical/TTest.decl.d.ts +4 -0
- package/types/src/.generated/desc/financial/Annuity.desc.d.ts +5 -0
- package/types/src/.generated/desc/financial/{Financial.desc.d.ts → Cashflow.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Convert.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Coupon.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{Financial2.desc.d.ts → Depreciation.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Growth.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{ODD.desc.d.ts → Odd.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/{Financial3.desc.d.ts → STOCKHISTORY.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Security.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{Financial4.desc.d.ts → SecurityMaturity.desc.d.ts} +1 -1
- package/types/src/.generated/desc/{statistical/TTEST.desc.d.ts → financial/TBill.desc.d.ts} +1 -1
- package/types/src/.generated/desc/statistical/{ETS.desc.d.ts → Ets.desc.d.ts} +1 -1
- package/types/src/.generated/desc/statistical/TTest.desc.d.ts +4 -0
- package/types/src/_utils/AnyArgs.d.ts +17 -3
- package/types/src/_utils/FinanaceSolver.d.ts +39 -2
- package/types/src/_utils/FinanceAmor.d.ts +23 -0
- package/types/src/_utils/FinanceCashflow.d.ts +42 -0
- package/types/src/_utils/FinanceCoupon.d.ts +92 -82
- package/types/src/_utils/FinanceDate.d.ts +24 -0
- package/types/src/_utils/FinanceDayCount.d.ts +46 -0
- package/types/src/_utils/FinanceOdd.d.ts +93 -0
- package/types/src/_utils/FinanceSecurity.d.ts +84 -0
- package/types/src/_utils/FinanceUtils.d.ts +34 -0
- package/types/src/_utils/LeastSquares.d.ts +20 -22
- package/types/src/_utils/RegexCompile.d.ts +33 -0
- package/types/src/cube/Cube.d.ts +7 -7
- package/types/src/financial/ACCRINT.d.ts +33 -6
- package/types/src/financial/AMORDEGRC.d.ts +22 -40
- package/types/src/financial/Annuity.d.ts +118 -0
- package/types/src/financial/Cashflow.d.ts +84 -0
- package/types/src/financial/Convert.d.ts +26 -0
- package/types/src/financial/Coupon.d.ts +72 -0
- package/types/src/financial/Date.d.ts +34 -5
- package/types/src/financial/Depreciation.d.ts +58 -0
- package/types/src/financial/Growth.d.ts +22 -0
- package/types/src/financial/Odd.d.ts +82 -0
- package/types/src/financial/STOCKHISTORY.d.ts +17 -0
- package/types/src/financial/Security.d.ts +68 -0
- package/types/src/financial/SecurityMaturity.d.ts +107 -0
- package/types/src/financial/TBill.d.ts +40 -0
- package/types/src/financial/VDB.d.ts +15 -13
- package/types/src/statistical/{ETS.d.ts → Ets.d.ts} +14 -14
- package/types/src/statistical/Regression.d.ts +13 -18
- package/types/src/statistical/{TTEST.d.ts → TTest.d.ts} +5 -5
- package/types/src/text/RegEx.d.ts +34 -11
- package/browser/cjs/B4JJfKSI4ppwU855.cjs +0 -1
- package/browser/cjs/BwLx9ix5Sq7suAYP.cjs +0 -1
- package/browser/cjs/Clu7XiAsCB48GDXN.cjs +0 -1
- package/browser/cjs/DsFZgtSQpC75d1M0.cjs +0 -1
- package/browser/cjs/fqTQ_p3ehzUvc1tF.cjs +0 -1
- package/browser/cjs/h3dw1jAp2J5Pu4p3.cjs +0 -1
- package/browser/cjs/jev6VGWTdgEgm4Yk.cjs +0 -1
- package/browser/esm/CwoMEzOtRihuYUTr.mjs +0 -20
- package/browser/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
- package/node/esm/CwoMEzOtRihuYUTr.mjs +0 -20
- package/node/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
- package/types/src/financial/Financial.d.ts +0 -288
- package/types/src/financial/Financial2.d.ts +0 -99
- package/types/src/financial/Financial3.d.ts +0 -95
- package/types/src/financial/Financial4.d.ts +0 -82
- package/types/src/financial/ODD.d.ts +0 -106
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Scalar, Omittable, NoLift, ReportType } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* When payments are due in each period.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Declared `ReportType`, as every numeric built-in enum is: Excel reads any nonzero value as 1
|
|
7
|
+
* (`2`, `-1` and `0.5` all mean "beginning", measured), which an enum's gate does not, so the
|
|
8
|
+
* bodies keep the verdict. CUMIPMT and CUMPRINC declare it as `PaymentType | Scalar`: their bodies
|
|
9
|
+
* read the raw argument themselves, and answer #NUM! for anything but 0 or 1.
|
|
10
|
+
*/
|
|
11
|
+
declare enum PaymentType {
|
|
12
|
+
/**
|
|
13
|
+
* Payments are due at the end of each period.
|
|
14
|
+
* @name At the end of the period
|
|
15
|
+
*/
|
|
16
|
+
End = 0,
|
|
17
|
+
/**
|
|
18
|
+
* Payments are due at the beginning of each period.
|
|
19
|
+
* @name At the beginning of the period
|
|
20
|
+
*/
|
|
21
|
+
Beginning = 1
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns the future value of an investment based on periodic, constant payments and a constant interest rate.
|
|
25
|
+
* @param rate is the interest rate.
|
|
26
|
+
* @param nper is the total number of payment periods.
|
|
27
|
+
* @param pmt is the payment made each period; it cannot change over the life of the investment.
|
|
28
|
+
* @param pv is the present value of the investment.
|
|
29
|
+
* @param type Indicates when payments are due: at the end of the period = 0, at the beginning of the period = 1.
|
|
30
|
+
*/
|
|
31
|
+
export declare function FV(rate: number, nper: number, pmt: number, pv?: number, type?: ReportType<PaymentType>): number;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the present value of an investment: the total amount that a series of future payments is worth now.
|
|
34
|
+
* @param rate is the interest rate.
|
|
35
|
+
* @param nper is the total number of payment periods in an investment.
|
|
36
|
+
* @param pmt is the payment made each period and cannot change over the life of the investment.
|
|
37
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
38
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
39
|
+
*/
|
|
40
|
+
export declare function PV(rate: number, nper: number, pmt: number, fv?: number, type?: ReportType<PaymentType>): number;
|
|
41
|
+
/**
|
|
42
|
+
* Calculates the payment for a loan based on constant payments and a constant interest rate.
|
|
43
|
+
* @param rate is the interest rate.
|
|
44
|
+
* @param nper is the total number of payment periods.
|
|
45
|
+
* @param pv is the present value of the investment.
|
|
46
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
47
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
48
|
+
*/
|
|
49
|
+
export declare function PMT(rate: number, nper: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.
|
|
52
|
+
* @param rate is the interest rate per period. For example, use 6%/4 for quarterly payments at 6% APR.
|
|
53
|
+
* @param pmt is the payment made each period; it cannot change over the life of the investment.
|
|
54
|
+
* @param pv is the present value, or the lump-sum amount that a series of future payments is worth now.
|
|
55
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
56
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
57
|
+
*/
|
|
58
|
+
export declare function NPER(rate: number, pmt: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the interest rate per period of a loan or an investment. For example, use 6%/4 for quarterly payments at 6% APR.
|
|
61
|
+
* @param nper is the total number of payment periods.
|
|
62
|
+
* @param pmt is the payment made each period and cannot change over the life of the loan or investment.
|
|
63
|
+
* @param pv is the present value: the total amount that a series of future payments is worth now.
|
|
64
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
65
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
66
|
+
* @param guess is your guess for what the rate will be.
|
|
67
|
+
*/
|
|
68
|
+
export declare function RATE(nper: number, pmt: number, pv: number, fv?: number, type?: ReportType<PaymentType>, guess?: number): number;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the interest payment for a given period for an investment, based on periodic, constant payments and a constant interest rate.
|
|
71
|
+
* @param rate is the interest rate.
|
|
72
|
+
* @param per is the period for which you want to find the interest and must be in the range 1 to Nper.
|
|
73
|
+
* @param nper is the total number of payment periods.
|
|
74
|
+
* @param pv is the present value of the investment.
|
|
75
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
76
|
+
* @param type is a logical value representing the timing of payment: at the end of the period = 0, at the beginning of the period = 1.
|
|
77
|
+
*/
|
|
78
|
+
export declare function IPMT(rate: number, per: number, nper: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the payment on the principal for a given investment based on periodic, constant payments and a constant payments and a constant interest rate.
|
|
81
|
+
* @param rate is the interest rate per period.
|
|
82
|
+
* @param per is the period for which you want to find the principal payment and must be in the range 1 to Nper.
|
|
83
|
+
* @param nper is the total number of payment periods in the investment.
|
|
84
|
+
* @param pv is the present value of the investment.
|
|
85
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
86
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
87
|
+
*/
|
|
88
|
+
export declare function PPMT(rate: number, per: number, nper: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the cumulative interest paid between two periods.
|
|
91
|
+
* @param rate is the interest rate.
|
|
92
|
+
* @param nper is the total number of payment periods.
|
|
93
|
+
* @param pv is the present value of the investment.
|
|
94
|
+
* @param startPeriod is the first period in the calculation.
|
|
95
|
+
* @param endPeriod is the last period in the calculation.
|
|
96
|
+
* @param type is the timing of the payment.
|
|
97
|
+
*/
|
|
98
|
+
export declare function CUMIPMT(rate: NoLift<Omittable<Scalar>>, nper: NoLift<Omittable<Scalar>>, pv: NoLift<Omittable<Scalar>>, startPeriod: NoLift<Omittable<Scalar>>, endPeriod: NoLift<Omittable<Scalar>>, type: NoLift<Omittable<PaymentType | Scalar>>): number;
|
|
99
|
+
/**
|
|
100
|
+
* Returns the cumulative principal paid on a loan between two periods.
|
|
101
|
+
* @param rate is the interest rate.
|
|
102
|
+
* @param nper is the total number of payment periods.
|
|
103
|
+
* @param pv is the present value of the investment.
|
|
104
|
+
* @param startPeriod is the first period in the calculation.
|
|
105
|
+
* @param endPeriod is the last period in the calculation.
|
|
106
|
+
* @param type is the timing of the payment.
|
|
107
|
+
*/
|
|
108
|
+
export declare function CUMPRINC(rate: NoLift<Omittable<Scalar>>, nper: NoLift<Omittable<Scalar>>, pv: NoLift<Omittable<Scalar>>, startPeriod: NoLift<Omittable<Scalar>>, endPeriod: NoLift<Omittable<Scalar>>, type: NoLift<Omittable<PaymentType | Scalar>>): number;
|
|
109
|
+
/**
|
|
110
|
+
* Returns the interest paid during a specific period of an investment.
|
|
111
|
+
* @param rate is the interest rate.
|
|
112
|
+
* @param per period for which you want to find the interest.
|
|
113
|
+
* @param nper number of payment periods in an investment.
|
|
114
|
+
* @param pv lump sum amount that a series of future payments is right now.
|
|
115
|
+
*/
|
|
116
|
+
export declare function ISPMT(rate: number, per: number, nper: number, pv: number): number;
|
|
117
|
+
export {};
|
|
118
|
+
//# sourceMappingURL=Annuity.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Scalar, Omittable, AcceptError, IRange, Flatten, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the net present value of an investment based on a discount rate and a series of future payments (negative values) and income (positive values).
|
|
4
|
+
* @param rate is the rate of discount over the length of one period.
|
|
5
|
+
* @param value are 1 to 254 payments and income, equally spaced in time and occurring at the end of each period.
|
|
6
|
+
*/
|
|
7
|
+
export declare function NPV(rate: number, value: IRange<number>[]): number;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the internal rate of return for a series of cash flows.
|
|
10
|
+
* @param values is an array or a reference to cells that contain numbers for which you want to calculate the internal rate of return.
|
|
11
|
+
* @param guess is a number that you guess is close to the result of IRR.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Measured against Excel 16.0 (fn-battery financial/IRR plus `adhoc-irr-iterates` and
|
|
15
|
+
* `adhoc-irr-guess`, 2026-08-29). The member rule is NPV's — a text, boolean, blank or
|
|
16
|
+
* empty-string member is SKIPPED and the periods close up behind it, so `{-100,TRUE,110}` is the
|
|
17
|
+
* two-flow 10% — while an error member is `#VALUE!` whatever its own identity was. An error handed
|
|
18
|
+
* as the whole argument is not a member and keeps its identity (`IRR(NA())` is `#N/A`). `guess` is
|
|
19
|
+
* declared `number` (a boolean coerces, a text is `#VALUE!`), an ABSENT argument is 0.1 where an
|
|
20
|
+
* EMPTY slot and a blank cell are 0, and the domain is the one RATE has at both ends:
|
|
21
|
+
* `guess <= -1` is `#VALUE!`, and so is a guess so large that `1 + guess` is `guess` again
|
|
22
|
+
* (the turn is at 2^53 — `IRR(…,9.007E15)` answers and `IRR(…,9.008E15)` does not).
|
|
23
|
+
*/
|
|
24
|
+
export declare function IRR(values: Omittable<Flatten<AcceptError<Scalar>>>, guess?: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the modified internal rate of return for a series of periodic cash flows.
|
|
27
|
+
* @param values An array of cash flows; must contain at least one positive and one negative value.
|
|
28
|
+
* @param financeRate The interest rate paid on negative cash flows (cost of capital).
|
|
29
|
+
* @param reinvestRate The interest rate received on positive cash flows (reinvestment rate).
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Measured against Excel 16.0 (fn-battery financial/MIRR, 2026-08-29). The member rule is IRR's —
|
|
33
|
+
* a text, boolean, blank or empty-string member is SKIPPED and the periods close up, so it also
|
|
34
|
+
* shortens the `n` the exponent counts — but an error member keeps its own identity here where
|
|
35
|
+
* IRR flattens every one to `#VALUE!`. The two rates are declared `number` (a boolean coerces, an
|
|
36
|
+
* empty slot and a blank cell are 0) and are read before the members, so a text rate beats an
|
|
37
|
+
* `#N/A` in the schedule.
|
|
38
|
+
*
|
|
39
|
+
* The form is the documented one, and each side DIVIDES by its own compounding — which is where
|
|
40
|
+
* `#DIV/0!` comes from at a rate of −1 (a flow at period 0 divides by `(1+r)^0` and survives one:
|
|
41
|
+
* `MIRR({-100,110},-1,0)` is 10% while `MIRR({-100,110},0,-1)` is not). Fewer than two flows, or
|
|
42
|
+
* no outflow at all, divides by zero as well.
|
|
43
|
+
*/
|
|
44
|
+
export declare function MIRR(values: Omittable<Flatten<AcceptError<Scalar>>>, financeRate: number, reinvestRate: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the net present value for a schedule of cash flows.
|
|
47
|
+
* @param rate is the discount rate to apply to the cash flows.
|
|
48
|
+
* @param values is a series of cash flows that correspond to a schedule of payments in dates.
|
|
49
|
+
* @param dates is a schedule of payment dates that corresponds to the cash flow payments.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* Measured against Excel 16.0 (fn-battery financial/XNPV, 2026-08-29). Each flow is discounted
|
|
53
|
+
* over ACTUAL days from the FIRST date on a 365-day year — `(trunc(dᵢ) − trunc(d₀))/365`, each
|
|
54
|
+
* serial truncated on its own, so a fractional date changes nothing. The dates need not be
|
|
55
|
+
* sorted; they need only fall at or after `d₀`, and a date before it is #NUM!. The rate is
|
|
56
|
+
* strictly positive (0 and below are #NUM!, 1E-300 is an answer), and a discount factor or a
|
|
57
|
+
* sum that overflows is #NUM!. The operands read as {@link readDatedFlows} describes.
|
|
58
|
+
*/
|
|
59
|
+
export declare function XNPV(rate: NoLift<Omittable<Scalar>>, values: Omittable<IRange>, dates: Omittable<IRange>): number;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the internal rate of return for a schedule of cash flows.
|
|
62
|
+
* @param values is a series of cash flows that correspond to a schedule of payments in dates.
|
|
63
|
+
* @param dates is a schedule of payment dates that corresponds to the cash flow payments.
|
|
64
|
+
* @param guess is a number that you guess is close to the result of XIRR.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* Measured against Excel 16.0 (fn-battery financial/XIRR, 2026-08-29). XIRR is XNPV's equation
|
|
68
|
+
* solved for the rate — the same `(trunc(dᵢ) − trunc(d₀))/365` day count — but neither its
|
|
69
|
+
* operands nor its answer are XNPV's. The members are COERCED rather than refused (numeric text
|
|
70
|
+
* and date text parse; a boolean or a true text is `#VALUE!`), a pair whose VALUE is blank is
|
|
71
|
+
* DROPPED, serial 0 is legal, and the dates need not be ordered at all: a flow before `d₀` is
|
|
72
|
+
* discounted by a negative exponent. Fewer than two surviving pairs is `#N/A`; two of the same
|
|
73
|
+
* sign is `#NUM!`. `guess` is ATP `any` — a boolean is `#VALUE!`, an EMPTY slot is the 0.1
|
|
74
|
+
* default where a blank cell is 0, and a reference does not lift.
|
|
75
|
+
*
|
|
76
|
+
* Excel's own answer is only accurate to about eight digits and moves with the guess in the
|
|
77
|
+
* ninth, so the fixture's numeric rows carry a `precision` (CALC-ISSUES 26): its
|
|
78
|
+
* iteration is unidentified, as YIELD's and ODDFYIELD's are. What IS reproduced is the search's
|
|
79
|
+
* one directional rule — from a NEGATIVE guess Excel never reaches a positive root
|
|
80
|
+
* (`XIRR({-100,110},…,-0.5)` is `#NUM!` while the same call at guess 0 answers 10%), though a
|
|
81
|
+
* non-negative guess reaches a negative root freely.
|
|
82
|
+
*/
|
|
83
|
+
export declare function XIRR(values: Omittable<IRange>, dates: Omittable<IRange>, guess?: NoLift<Omittable<Scalar>>): number;
|
|
84
|
+
//# sourceMappingURL=Cashflow.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the effective annual interest rate.
|
|
4
|
+
* @param nominalRate is the nominal interest rate.
|
|
5
|
+
* @param npery is the number of compounding periods per year.
|
|
6
|
+
*/
|
|
7
|
+
export declare function EFFECT(nominalRate: NoLift<Omittable<Scalar>>, npery: NoLift<Omittable<Scalar>>): number;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the annual nominal interest rate.
|
|
10
|
+
* @param effectiveRate is the effective interest rate.
|
|
11
|
+
* @param npery is the number of compounding periods per year.
|
|
12
|
+
*/
|
|
13
|
+
export declare function NOMINAL(effectiveRate: NoLift<Omittable<Scalar>>, npery: NoLift<Omittable<Scalar>>): number;
|
|
14
|
+
/**
|
|
15
|
+
* Converts a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.
|
|
16
|
+
* @param fractionalDollar is a number expressed as a fraction.
|
|
17
|
+
* @param fraction is the integer to use in the denominator of the fraction.
|
|
18
|
+
*/
|
|
19
|
+
export declare function DOLLARDE(fractionalDollar: NoLift<Omittable<Scalar>>, fraction: NoLift<Omittable<Scalar>>): number;
|
|
20
|
+
/**
|
|
21
|
+
* Converts a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.
|
|
22
|
+
* @param decimalDollar is a decimal number.
|
|
23
|
+
* @param fraction is the integer to use in the denominator of the fraction.
|
|
24
|
+
*/
|
|
25
|
+
export declare function DOLLARFR(decimalDollar: NoLift<Omittable<Scalar>>, fraction: NoLift<Omittable<Scalar>>): number;
|
|
26
|
+
//# sourceMappingURL=Convert.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Omittable, Scalar, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Coupon date and day-count functions.
|
|
4
|
+
*
|
|
5
|
+
* The six share one argument reader, `readCouponArgs` — every slot is Excel-declared `any`,
|
|
6
|
+
* the dates and frequency validate before the basis is read — and one coupon chain,
|
|
7
|
+
* `FinanceCoupon`'s, both measured against Excel 16.0 (fn-battery financial/COUP*,
|
|
8
|
+
* 2026-08-28). COUPNCD and COUPPCD return date serials, not day counts.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Returns the number of days from the beginning of the coupon period to the settlement date.
|
|
12
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
13
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
14
|
+
* @param frequency is the number of coupon payments per year.
|
|
15
|
+
* @param basis is the type of day count basis to use.
|
|
16
|
+
*/
|
|
17
|
+
export declare function COUPDAYBS(settlement: NoLift<Omittable<Scalar>>, maturity: NoLift<Omittable<Scalar>>, frequency: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the number of days in the coupon period containing the settlement date.
|
|
20
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
21
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
22
|
+
* @param frequency is the number of coupon payments per year.
|
|
23
|
+
* @param basis is the type of day count basis to use.
|
|
24
|
+
*/
|
|
25
|
+
export declare function COUPDAYS(settlement: NoLift<Omittable<Scalar>>, maturity: NoLift<Omittable<Scalar>>, frequency: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the number of days from the settlement date to the next coupon date.
|
|
28
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
29
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
30
|
+
* @param frequency is the number of coupon payments per year.
|
|
31
|
+
* @param basis is the type of day count basis to use.
|
|
32
|
+
*/
|
|
33
|
+
export declare function COUPDAYSNC(settlement: NoLift<Omittable<Scalar>>, maturity: NoLift<Omittable<Scalar>>, frequency: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the next coupon date after the settlement date.
|
|
36
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
37
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
38
|
+
* @param frequency is the number of coupon payments per year.
|
|
39
|
+
* @param basis is the type of day count basis to use.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Returns a date serial and leaves the cell's format alone — Excel does not hint one here, on a
|
|
43
|
+
* serial argument, on `DATE(...)` or on a date-formatted reference (measured 2026-08-29). No
|
|
44
|
+
* ATP-era date function does; `DATE` and `TODAY` do, and an operator such as `B1+1` propagates
|
|
45
|
+
* its operand's.
|
|
46
|
+
*/
|
|
47
|
+
export declare function COUPNCD(settlement: NoLift<Omittable<Scalar>>, maturity: NoLift<Omittable<Scalar>>, frequency: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the previous coupon date before the settlement date.
|
|
50
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
51
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
52
|
+
* @param frequency is the number of coupon payments per year.
|
|
53
|
+
* @param basis is the type of day count basis to use.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Returns a date serial and leaves the cell's format alone, as COUPNCD does. A previous coupon
|
|
57
|
+
* date below the calendar (a settlement in the first days of 1900) answers 0, as Excel does.
|
|
58
|
+
*/
|
|
59
|
+
export declare function COUPPCD(settlement: NoLift<Omittable<Scalar>>, maturity: NoLift<Omittable<Scalar>>, frequency: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the number of coupons payable between the settlement date and maturity date.
|
|
62
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
63
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
64
|
+
* @param frequency is the number of coupon payments per year.
|
|
65
|
+
* @param basis is the type of day count basis to use.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* A previous coupon date at or below the calendar's serial 0 is #NUM!, where COUPPCD itself
|
|
69
|
+
* still answers 0 (measured).
|
|
70
|
+
*/
|
|
71
|
+
export declare function COUPNUM(settlement: NoLift<Omittable<Scalar>>, maturity: NoLift<Omittable<Scalar>>, frequency: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
72
|
+
//# sourceMappingURL=Coupon.d.ts.map
|
|
@@ -1,27 +1,56 @@
|
|
|
1
|
-
import { Scalar } from '@sheetxl/primitives';
|
|
1
|
+
import { AcceptError, Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
2
2
|
/**
|
|
3
|
+
* Returns the number of days between two dates.
|
|
3
4
|
* @hidden Legacy
|
|
4
|
-
* @summary Returns the number of days between two dates.
|
|
5
5
|
* @param startDate is a serial date number that represents the start date.
|
|
6
6
|
* @param endDate is a serial date number that represents the end date.
|
|
7
7
|
* @param unit is a string that specifies the unit of time to use.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Measured against Excel 16.0 (fn-battery financial/DATEDIF, 2026-08-28). Both serials are
|
|
11
|
+
* truncated before anything is compared (`DATEDIF(37179.6,37179.5,"d")` is 0); a serial outside
|
|
12
|
+
* the calendar is #NUM!, as is a start after the end, and so is a unit that is not exactly one
|
|
13
|
+
* of Y M D MD YM YD in either case — nothing is trimmed, and a number or a boolean arrives as
|
|
14
|
+
* text and is refused the same way. `"MD"` re-anchors the start's day into the end's month
|
|
15
|
+
* (the documented negative answers are Excel's own: Jan 31 → Mar 1 is −2). `"YD"` is the
|
|
16
|
+
* `"YM"` months and `"MD"` days walked forward from the start, so it counts on the START year's
|
|
17
|
+
* calendar — Jan 1 2004 → Mar 1 2005 is 60 where Jan 1 2003 → Mar 1 2004 is 59 (the documented
|
|
18
|
+
* leap-year quirk), and Feb 29 2004 → Mar 1 2005 is 0.
|
|
8
19
|
*/
|
|
9
20
|
export declare function DATEDIF(startDate: number, // Date
|
|
10
21
|
endDate: number, // Date
|
|
11
22
|
unit: string): number;
|
|
12
23
|
/**
|
|
13
|
-
*
|
|
24
|
+
* Returns the year fraction representing the number of whole days between start_date and end_date.
|
|
14
25
|
* @param startDate is a serial date number that represents the start date.
|
|
15
26
|
* @param endDate is a serial date number that represents the end date.
|
|
16
27
|
* @param basis is the type of day count basis to use.
|
|
17
28
|
* @category Date & Time
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Measured against Excel 16.0 (fn-battery financial/YEARFRAC, 2026-08-28). Excel declares all
|
|
32
|
+
* three arguments `any`: a boolean is #VALUE!, an empty argument is #N/A where a blank cell is
|
|
33
|
+
* serial 0, and a multi-cell reference does not broadcast while an array constant does. The
|
|
34
|
+
* basis is read and validated FIRST — truncated, #NUM! below 0 or above 4, so
|
|
35
|
+
* `YEARFRAC("x",39814,5)` is #NUM! and `YEARFRAC(NA(),39814,"x")` is #VALUE! (the dates
|
|
36
|
+
* accept an error so that the body, not the marshaller, decides which is seen first) — then
|
|
37
|
+
* the start, then the end, each coerced and range-checked in turn (`YEARFRAC(-1,"x",0)` is
|
|
38
|
+
* #NUM!). The day counts are `getYearFrac`'s: serials truncated, dates ordered, basis 0
|
|
39
|
+
* signed.
|
|
18
40
|
*/
|
|
19
|
-
export declare function YEARFRAC(startDate: Scalar
|
|
41
|
+
export declare function YEARFRAC(startDate: NoLift<Omittable<AcceptError<Scalar>>>, endDate: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
20
42
|
/**
|
|
21
|
-
*
|
|
43
|
+
* Returns the number of days between two dates based on a 360-day year (twelve 30-day months).
|
|
22
44
|
* @param endDate startDate and endDate are the two dates between which you want to know the number of days.
|
|
23
45
|
* @param startDate startDate and endDate are the two dates between which you want to know the number of days.
|
|
24
46
|
* @param method is a logical value specifying the calculation method: U.S. (NASD) = FALSE; European = TRUE.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Measured against Excel 16.0 (fn-battery financial/DAYS360, 2026-08-28). Excel declares the
|
|
50
|
+
* dates `number` and the method `logical`, so the engine's coercion applies: a boolean date is
|
|
51
|
+
* its serial, a number is a method, `"TRUE"` is one while `"1"` is #VALUE!. A serial outside
|
|
52
|
+
* the calendar is #NUM! at either slot and the fraction is discarded. The US rules are
|
|
53
|
+
* `getDays360US`'s, applied to (start, end) as given.
|
|
25
54
|
*/
|
|
26
55
|
export declare function DAYS360(startDate: number, // date
|
|
27
56
|
endDate: number, // date
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the straight-line depreciation of an asset for one period.
|
|
4
|
+
* @param cost is the initial cost of the asset.
|
|
5
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
6
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
7
|
+
*/
|
|
8
|
+
export declare function SLN(cost: number, salvage: number, life: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the sum-of-years' digits depreciation of an asset for a specified period.
|
|
11
|
+
* @param cost is the initial cost of the asset.
|
|
12
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
13
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
14
|
+
* @param per is the period and must use the same units as Life.
|
|
15
|
+
*/
|
|
16
|
+
export declare function SYD(cost: number, salvage: number, life: number, per: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the depreciation of an asset for a specified period using the fixed-declining balance method.
|
|
19
|
+
* @param cost is the initial cost of the asset.
|
|
20
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
21
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
22
|
+
* @param period is the period for which you want to calculate the depreciation. Period must use the same units as Life.
|
|
23
|
+
* @param month is the number of months in the first year.
|
|
24
|
+
*/
|
|
25
|
+
export declare function DB(cost: number, salvage: number, life: number, period: number, month?: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the depreciation of an asset for a specified period using the double-declining balance method or some other method you specify.
|
|
28
|
+
* @param cost is the initial cost of the asset.
|
|
29
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
30
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
31
|
+
* @param period is the period for which you want to calculate the depreciation. Period must use the same units as Life.
|
|
32
|
+
* @param factor is the rate at which the balance declines.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Double declining balance (DDB) depreciation method.
|
|
36
|
+
*/
|
|
37
|
+
export declare function DDB(cost: number, salvage: number, life: number, period: number, factor?: number): number;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the prorated linear depreciation of an asset for each accounting period.
|
|
40
|
+
* @param cost is the cost of the asset.
|
|
41
|
+
* @param datePurchased is the date the asset is purchased.
|
|
42
|
+
* @param firstPeriod is the date of the end of the first period.
|
|
43
|
+
* @param salvage is the salvage value at the end of life of the asset.
|
|
44
|
+
* @param period is the period.
|
|
45
|
+
* @param rate is the rate of depreciation.
|
|
46
|
+
* @param basis year basis : 0 for year of 360 days, 1 for actual, 3 for year of 365 days.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Measured against Excel 16.0 (fn-battery financial/AMORLINC, 2026-08-28). Period 0 is the
|
|
50
|
+
* stub from purchase to the end of the first period, pro-rated by `getAmorDayCount` (a
|
|
51
|
+
* zero-day stub is a whole period; a stub longer than a year is not capped) and capped at
|
|
52
|
+
* `cost − salvage`; every following period is `cost·rate` until the one that takes what is
|
|
53
|
+
* left, and 0 beyond. A period under 1 is period 1, above it truncates. Basis truncates and 2 is
|
|
54
|
+
* refused. Every argument is Excel-declared `any`: a boolean is refused, an empty argument is
|
|
55
|
+
* missing, a multi-cell reference does not broadcast.
|
|
56
|
+
*/
|
|
57
|
+
export declare function AMORLINC(cost: NoLift<Omittable<Scalar>>, datePurchased: NoLift<Omittable<Scalar>>, firstPeriod: NoLift<Omittable<Scalar>>, salvage: NoLift<Omittable<Scalar>>, period: NoLift<Omittable<Scalar>>, rate: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
58
|
+
//# sourceMappingURL=Depreciation.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Scalar, Omittable, IRange, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the future value of an initial principal after applying a series of compound interest rates.
|
|
4
|
+
* @param principal is the present value.
|
|
5
|
+
* @param schedule is an array of interest rates to apply.
|
|
6
|
+
*/
|
|
7
|
+
export declare function FVSCHEDULE(principal: NoLift<Omittable<Scalar>>, schedule: Omittable<IRange>): number;
|
|
8
|
+
/**
|
|
9
|
+
* Returns an equivalent interest rate for the growth of an investment.
|
|
10
|
+
* @param nper is the total number of payment periods.
|
|
11
|
+
* @param pv is the present value of the investment.
|
|
12
|
+
* @param fv is the future value of the investment.
|
|
13
|
+
*/
|
|
14
|
+
export declare function RRI(nper: number, pv: number, fv: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the number of periods required by an investment to reach a specified value.
|
|
17
|
+
* @param rate is the interest rate.
|
|
18
|
+
* @param pv is the present value of the investment.
|
|
19
|
+
* @param fv is the desired future value of the investment.
|
|
20
|
+
*/
|
|
21
|
+
export declare function PDURATION(rate: number, pv: number, fv: number): number;
|
|
22
|
+
//# sourceMappingURL=Growth.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AcceptError, Omittable, Scalar, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the price per $100 face value of a security with an odd first period.
|
|
4
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
5
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
6
|
+
* @param issue is the security's issue date, expressed as a serial date number.
|
|
7
|
+
* @param firstCoupon is the security's first coupon date, expressed as a serial date number.
|
|
8
|
+
* @param rate is the security's interest rate.
|
|
9
|
+
* @param yld is the security's annual yield.
|
|
10
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
11
|
+
* @param frequency is the number of coupon payments per year.
|
|
12
|
+
* @param basis is the type of day count basis to use.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The odd FIRST period `[issue, firstCoupon]` is short (a stub of one regular period) or long
|
|
16
|
+
* (several quasi-coupon periods); which, and the day-count sums of either, are
|
|
17
|
+
* {@link oddFirstSums} — measured against Excel 16.0 on 1,125 (shape, frequency, basis) triples
|
|
18
|
+
* and every row of its battery (fn-battery financial/ODDFPRICE, 2026-08-29), Excel's own
|
|
19
|
+
* month-end exponent quirk included. Reading and validation are {@link readOddArgs}'s, then
|
|
20
|
+
* `issue < settlement < firstCoupon < maturity` once truncated, the first coupon on the
|
|
21
|
+
* maturity's coupon grid, `rate ≥ 0`, `yld ≥ 0`, `redemption > 0`; an odd period exactly one
|
|
22
|
+
* regular period long is #NUM!.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ODDFPRICE(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, issue: NoLift<Omittable<AcceptError<Scalar>>>, firstCoupon: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, yld: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the yield of a security with an odd first period.
|
|
27
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
28
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
29
|
+
* @param issue is the security's issue date, expressed as a serial date number.
|
|
30
|
+
* @param firstCoupon is the security's first coupon date, expressed as a serial date number.
|
|
31
|
+
* @param rate is the security's interest rate.
|
|
32
|
+
* @param pr is the security's price.
|
|
33
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
34
|
+
* @param frequency is the number of coupon payments per year.
|
|
35
|
+
* @param basis is the type of day count basis to use.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* The root of ODDFPRICE in the yield — a power form, so an iterate (Newton with a numerical
|
|
39
|
+
* derivative, bisection when that fails), not a closed form. Reads and validates as ODDFPRICE
|
|
40
|
+
* does, with `pr > 0` in place of the yield's sign.
|
|
41
|
+
*/
|
|
42
|
+
export declare function ODDFYIELD(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, issue: NoLift<Omittable<AcceptError<Scalar>>>, firstCoupon: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the price per $100 face value of a security with an odd last period.
|
|
45
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
46
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
47
|
+
* @param lastInterest is the security's last coupon date, expressed as a serial date number.
|
|
48
|
+
* @param rate is the interest rate.
|
|
49
|
+
* @param yld is the security's annual yield.
|
|
50
|
+
* @param redemption is the amount to be received at maturity.
|
|
51
|
+
* @param frequency is the number of coupon payments per year.
|
|
52
|
+
* @param basis is the type of day count basis to use.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* `(redemption + C·ΣDCᵢ/NLᵢ) / (1 + yld/frequency · ΣDSCᵢ/NLᵢ) − C·ΣAᵢ/NLᵢ` with
|
|
56
|
+
* `C = 100·rate/frequency` — linear in the yield, since the whole bond is the one irregular
|
|
57
|
+
* period. The three sums are {@link oddLastSums}; a product that overflows is 0. Measured
|
|
58
|
+
* bit-for-bit on Excel 16.0 (fn-battery financial/ODDLPRICE, 556 numeric rows, 2026-08-28).
|
|
59
|
+
* Reading and validation are {@link readOddArgs}'s: `lastInterest < settlement < maturity` once
|
|
60
|
+
* truncated, `rate ≥ 0`, `yld ≥ 0`, `redemption > 0`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ODDLPRICE(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, lastInterest: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, yld: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the yield of a security with an odd last period.
|
|
65
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
66
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
67
|
+
* @param lastInterest is the security's last coupon date, expressed as a serial date number.
|
|
68
|
+
* @param rate is the interest rate.
|
|
69
|
+
* @param pr is the security's price.
|
|
70
|
+
* @param redemption is the amount to be received at maturity.
|
|
71
|
+
* @param frequency is the number of coupon payments per year.
|
|
72
|
+
* @param basis is the type of day count basis to use.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* ODDLPRICE inverted — a closed form, not an iterate, because the price is linear in the yield.
|
|
76
|
+
* The grouping is measured rather than derived: `(N − D)/D · (frequency/ΣDSC)` over
|
|
77
|
+
* `N = redemption + C·ΣDC`, `D = pr + C·ΣA` is bit-exact on all 560 numeric rows of the battery
|
|
78
|
+
* where `frequency·(N/D − 1)/ΣDSC` holds only 14.3 digits. Reads and validates as ODDLPRICE
|
|
79
|
+
* does, with `pr > 0` in place of the yield's sign.
|
|
80
|
+
*/
|
|
81
|
+
export declare function ODDLYIELD(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, lastInterest: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
82
|
+
//# sourceMappingURL=Odd.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IRange, Flatten } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an array of historical quote data for a symbol and date range you specify..
|
|
4
|
+
* @hidden Unimplemented RichData
|
|
5
|
+
* @param stock Symbol of financial instrument to be considered or a Stock data type.
|
|
6
|
+
* @param startDate First date to return data from.
|
|
7
|
+
* @param endDate Last date to return data from.
|
|
8
|
+
* @param interval A number indicating the granularity of the data; 0 - Daily, 1 - Weekly, 2 - Monthly.
|
|
9
|
+
* @param headers A logical value to add column header data; 0 - No column header, 1 - Show column header, 2 - Show instrument identifier and column header.
|
|
10
|
+
* @param properties A number indicating which column of data to return; 0 through 5.
|
|
11
|
+
*/
|
|
12
|
+
export declare function STOCKHISTORY(stock: string, startDate: number, // date
|
|
13
|
+
endDate?: number, // date
|
|
14
|
+
interval?: number, // 0=day, 1=week, 2=month
|
|
15
|
+
headers?: number, // 0=none, 1=field names, 2=field names and row numbers
|
|
16
|
+
properties?: Flatten<number>): Promise<IRange>;
|
|
17
|
+
//# sourceMappingURL=STOCKHISTORY.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AcceptError, Omittable, Scalar, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the price per $100 face value of a security that pays periodic interest.
|
|
4
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
5
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
6
|
+
* @param rate is the interest rate.
|
|
7
|
+
* @param yld is the security's annual yield.
|
|
8
|
+
* @param redemption is the amount to be received at maturity.
|
|
9
|
+
* @param frequency is the number of coupon payments per year.
|
|
10
|
+
* @param basis is the type of day count basis to use.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* The doc's closed form over `calculatePrice`'s coupon-period numbers; a negative rate or
|
|
14
|
+
* yield, a redemption at or below zero, and a previous coupon date below the calendar are
|
|
15
|
+
* #NUM!.
|
|
16
|
+
*/
|
|
17
|
+
export declare function PRICE(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, yld: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the annual duration of a security with periodic interest payments.
|
|
20
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
21
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
22
|
+
* @param coupon is the security's annual coupon rate.
|
|
23
|
+
* @param yld is the security's annual yield.
|
|
24
|
+
* @param frequency is the number of coupon payments per year.
|
|
25
|
+
* @param basis is the type of day count basis to use.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* The Macaulay duration — the present-value-weighted mean time to each cash flow, in coupon
|
|
29
|
+
* periods offset by the fraction of the current period already elapsed, over the frequency. A
|
|
30
|
+
* negative coupon or yield is #NUM!; a settlement in the first days of 1900 computes. Unlike
|
|
31
|
+
* PRICE, the slots read from the first and the basis last (`readBondArgs`).
|
|
32
|
+
*/
|
|
33
|
+
export declare function DURATION(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, coupon: NoLift<Omittable<AcceptError<Scalar>>>, yld: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the Macauley modified duration for a security with an assumed par value of $100.
|
|
36
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
37
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
38
|
+
* @param coupon is the security's annual coupon rate.
|
|
39
|
+
* @param yld is the security's annual yield.
|
|
40
|
+
* @param frequency is the number of coupon payments per year.
|
|
41
|
+
* @param basis is the type of day count basis to use.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* DURATION divided by `1 + yld/frequency`; the same reading and validation as DURATION.
|
|
45
|
+
*/
|
|
46
|
+
export declare function MDURATION(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, coupon: NoLift<Omittable<AcceptError<Scalar>>>, yld: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the yield on a security that pays periodic interest.
|
|
49
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
50
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
51
|
+
* @param rate is the security's annual coupon rate.
|
|
52
|
+
* @param pr is the security's price per $100 face value.
|
|
53
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
54
|
+
* @param frequency is the number of coupon payments per year.
|
|
55
|
+
* @param basis is the type of day count basis to use.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* PRICE inverted: the yield `y` with `PRICE(…, y, …) = pr`. With one coupon left the doc's closed
|
|
59
|
+
* form is used, over a coupon period that is the real span from the previous coupon to the
|
|
60
|
+
* maturity (so at bases 2 and 3 the single-coupon yield does not invert PRICE's 360/f or 365/f
|
|
61
|
+
* period). With more than one it is `solveYieldByNewton` on `calculatePrice` from
|
|
62
|
+
* `approximateYield` — an iteration that STOPS SHORT of the root, so the answer sits ~1e-10 away
|
|
63
|
+
* from it, and on a bond it cannot converge on (a redemption that dwarfs the price) it is simply
|
|
64
|
+
* where the walk stood after a hundred steps. Measured, fn-battery financial/YIELD and
|
|
65
|
+
* /adhoc-yield-* (2026-08-28, iteration 2026-09-09).
|
|
66
|
+
*/
|
|
67
|
+
export declare function YIELD(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
68
|
+
//# sourceMappingURL=Security.d.ts.map
|