@sheetxl/formulas-extended 0.8.0-beta.1 → 0.8.0-beta.11
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/esm/0yxQHUFt5rjQCIev.mjs +32 -0
- package/browser/esm/B0dkCLIUbDz5vaVn.mjs +37 -0
- package/browser/esm/BDiwqEqe9Jl-Rmly.mjs +19 -0
- package/browser/esm/BJjZHVPRHerJoONT.mjs +33 -0
- package/{node/esm/COqdI1LYTHd9oLA6.mjs → browser/esm/Bf0x5wP966yEyeU1.mjs} +1 -1
- package/browser/esm/BfcYyyl5rbLdyDeQ.mjs +58 -0
- package/{node/esm/srpVt74r2zbvm1N0.mjs → browser/esm/C2ZfbEIW-6-61CUe.mjs} +5 -5
- package/browser/esm/{BuGemmv84T8m0wqw.mjs → CNDVQpzD85y-8iJ4.mjs} +1 -1
- package/browser/esm/CZ7GTErfSkfNcFRk.mjs +32 -0
- package/browser/esm/CiTyrOKe-UEYKcPV.mjs +47 -0
- package/browser/esm/CjKII1gh4dO5nTCs.mjs +119 -0
- package/browser/esm/{DY3kG36QGyDbrANO.mjs → CoHdir1CxZhcwJYt.mjs} +1 -1
- package/browser/esm/D0XFBj8GRIDAu37v.mjs +20 -0
- package/{node/esm/DodhOXkSzelSxHmB.mjs → browser/esm/D25GpXzrju6GyQn2.mjs} +27 -29
- package/browser/esm/{DpoZ7h1ScIJvbOY9.mjs → D4kfW2yw0rsWNLi0.mjs} +5 -5
- package/{node/esm/vu0NRDeeTbEHPMYS.mjs → browser/esm/D4ySsDPVL4IH96en.mjs} +2 -2
- package/{node/esm/CnVJ8GAsshRjRGA-.mjs → browser/esm/DXTaMRX8ten_8WHT.mjs} +2 -2
- package/browser/esm/{B1VmvhXuEn7zaTB9.mjs → Dt0ErrS3YGvCicxr.mjs} +1 -1
- package/{node/esm/BRwwvGaJ6HvkxjFC.mjs → browser/esm/cfrOLasJbMwF7L77.mjs} +1 -1
- package/browser/esm/declarations.mjs +99 -0
- package/browser/esm/g4CKPtGz1NpGDtQq.mjs +2449 -0
- package/browser/esm/index.mjs +2281 -2585
- package/browser/esm/o8LeKZ4-9nq29pqg.mjs +23 -0
- package/{node/esm/Bma3CN4_Nec6_4n7.mjs → browser/esm/qAolCiBy-hQL59hu.mjs} +6 -6
- package/browser/esm/{BFnDPCjxJcoIItFa.mjs → zWOO2QFn-kMYJv1L.mjs} +3 -3
- package/node/esm/0vsGDvrSkTeFOp0A.mjs +19 -0
- package/node/esm/0yxQHUFt5rjQCIev.mjs +32 -0
- package/node/esm/B0dkCLIUbDz5vaVn.mjs +37 -0
- package/node/esm/BJjZHVPRHerJoONT.mjs +33 -0
- package/{browser/esm/COqdI1LYTHd9oLA6.mjs → node/esm/Bf0x5wP966yEyeU1.mjs} +1 -1
- package/node/esm/BfcYyyl5rbLdyDeQ.mjs +58 -0
- package/node/esm/{LAkTk93odAfpvx50.mjs → Bnco0vB0yNDiLGre.mjs} +1 -1
- package/{browser/esm/srpVt74r2zbvm1N0.mjs → node/esm/C2ZfbEIW-6-61CUe.mjs} +5 -5
- package/node/esm/{BQyZVLTMNFLbjVap.mjs → C3Qy2cWt_qACxJiF.mjs} +3 -3
- package/node/esm/{BuGemmv84T8m0wqw.mjs → CNDVQpzD85y-8iJ4.mjs} +1 -1
- package/node/esm/CZ7GTErfSkfNcFRk.mjs +32 -0
- package/node/esm/CgY5V9Cmm0UJmyGW.mjs +2449 -0
- package/node/esm/CiTyrOKe-UEYKcPV.mjs +47 -0
- package/node/esm/CjKII1gh4dO5nTCs.mjs +119 -0
- package/node/esm/D0XFBj8GRIDAu37v.mjs +20 -0
- package/{browser/esm/DodhOXkSzelSxHmB.mjs → node/esm/D25GpXzrju6GyQn2.mjs} +27 -29
- package/node/esm/{DpoZ7h1ScIJvbOY9.mjs → D4kfW2yw0rsWNLi0.mjs} +5 -5
- package/{browser/esm/vu0NRDeeTbEHPMYS.mjs → node/esm/D4ySsDPVL4IH96en.mjs} +2 -2
- package/{browser/esm/CnVJ8GAsshRjRGA-.mjs → node/esm/DXTaMRX8ten_8WHT.mjs} +2 -2
- package/node/esm/{B1VmvhXuEn7zaTB9.mjs → Dt0ErrS3YGvCicxr.mjs} +1 -1
- package/{browser/esm/BRwwvGaJ6HvkxjFC.mjs → node/esm/cfrOLasJbMwF7L77.mjs} +1 -1
- package/node/esm/declarations.mjs +99 -0
- package/node/esm/index.mjs +2551 -2837
- package/node/esm/o8LeKZ4-9nq29pqg.mjs +23 -0
- package/{browser/esm/Bma3CN4_Nec6_4n7.mjs → node/esm/qAolCiBy-hQL59hu.mjs} +6 -6
- package/package.json +11 -6
- package/types/declarations.d.ts +4 -0
- 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/lookupReference/GroupBy.decl.d.ts +4 -0
- package/types/src/.generated/decl/lookupReference/PivotBy.decl.d.ts +4 -0
- 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/declarations.d.ts +7 -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/lookupReference/GroupBy.desc.d.ts +4 -0
- package/types/src/.generated/desc/lookupReference/PivotBy.desc.d.ts +4 -0
- 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 +37 -1
- package/types/src/_utils/LeastSquares.d.ts +20 -22
- package/types/src/_utils/Pivot.d.ts +205 -0
- 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/lookupReference/GroupBy.d.ts +14 -0
- package/types/src/lookupReference/PivotBy.d.ts +17 -0
- 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/BWDfauDHqB6U_2ka.cjs +0 -1
- package/browser/cjs/BwLx9ix5Sq7suAYP.cjs +0 -1
- package/browser/cjs/C2uDl8VIJqh58YF_.cjs +0 -1
- package/browser/cjs/CW-b31_-r-_raT8Y.cjs +0 -1
- package/browser/cjs/Clu7XiAsCB48GDXN.cjs +0 -1
- package/browser/cjs/CnZfa45XxA-9Jhmp.cjs +0 -1
- package/browser/cjs/DsFZgtSQpC75d1M0.cjs +0 -1
- package/browser/cjs/JfM6P_qoQQTWakZf.cjs +0 -1
- package/browser/cjs/bM25C5avKgBAJVfk.cjs +0 -1
- package/browser/cjs/fqTQ_p3ehzUvc1tF.cjs +0 -1
- package/browser/cjs/h3dw1jAp2J5Pu4p3.cjs +0 -1
- package/browser/cjs/index.cjs +0 -1
- package/browser/cjs/jev6VGWTdgEgm4Yk.cjs +0 -1
- package/browser/cjs/lEQC21-Sk4lwHy2r.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,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
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { AcceptError, Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the discount rate for a security.
|
|
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 pr is the security's price per $100 face value.
|
|
7
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
8
|
+
* @param basis is the type of day count basis to use.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* `(1 − pr/redemption)` over YEARFRAC's year fraction of the two dates — the signed NASD count
|
|
12
|
+
* at basis 0, the 365/366 rules at basis 1 — measured against Excel 16.0 (fn-battery
|
|
13
|
+
* financial/DISC, 2026-08-28); a price above the redemption is a negative rate, and a
|
|
14
|
+
* zero-day 30/360 span (Mar 30 → Mar 31) is #NUM!. The arguments read as
|
|
15
|
+
* {@link readDiscountArgs} describes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function DISC(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the price per $100 face value of a discounted security.
|
|
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 discount is the security's discount rate.
|
|
23
|
+
* @param redemption is the amount to be received at maturity.
|
|
24
|
+
* @param basis is the type of day count basis to use.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* `redemption − discount · redemption · yearfrac` with YEARFRAC's year fraction, measured
|
|
28
|
+
* against Excel 16.0 (fn-battery financial/PRICEDISC, 2026-08-28): a discount that exhausts
|
|
29
|
+
* the redemption gives a negative price, and the product overflowing is #NUM!. The arguments
|
|
30
|
+
* read as {@link readDiscountArgs} describes.
|
|
31
|
+
*/
|
|
32
|
+
export declare function PRICEDISC(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, discount: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the annual yield for a discounted security. For example, a treasury bill.
|
|
35
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
36
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
37
|
+
* @param pr is the security's price per $100 face value.
|
|
38
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
39
|
+
* @param basis is the type of day count basis to use.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* `(redemption − pr)/pr` over YEARFRAC's year fraction, measured against Excel 16.0 (fn-battery
|
|
43
|
+
* financial/YIELDDISC, 2026-08-28); a price above the redemption is a negative yield. The
|
|
44
|
+
* arguments read as {@link readDiscountArgs} describes.
|
|
45
|
+
*/
|
|
46
|
+
export declare function YIELDDISC(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the interest rate for a fully invested security.
|
|
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 investment is the amount invested in the security.
|
|
52
|
+
* @param redemption is the amount to be received at maturity.
|
|
53
|
+
* @param basis is the type of day count basis to use.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* `(redemption − investment)/investment` over YEARFRAC's year fraction, measured against Excel 16.0
|
|
57
|
+
* (fn-battery financial/INTRATE, 2026-08-28); a redemption below the investment is a negative
|
|
58
|
+
* rate. The arguments read as {@link readDiscountArgs} describes.
|
|
59
|
+
*/
|
|
60
|
+
export declare function INTRATE(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, investment: NoLift<Omittable<AcceptError<Scalar>>>, redemption: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the amount received at maturity for a fully invested security.
|
|
63
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
64
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
65
|
+
* @param investment is the amount invested in the security.
|
|
66
|
+
* @param discount is the security's discount rate.
|
|
67
|
+
* @param basis is the type of day count basis to use.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* `investment / (1 − discount · yearfrac)` with YEARFRAC's year fraction, measured against
|
|
71
|
+
* Excel 16.0 (fn-battery financial/RECEIVED, 2026-08-28); a denominator at or below zero (a
|
|
72
|
+
* discount of 4 over a 90/360 quarter) is #NUM!. The arguments read as
|
|
73
|
+
* {@link readDiscountArgs} describes.
|
|
74
|
+
*/
|
|
75
|
+
export declare function RECEIVED(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, investment: NoLift<Omittable<AcceptError<Scalar>>>, discount: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
76
|
+
/**
|
|
77
|
+
* Returns the price per $100 face value of a security that pays interest at maturity.
|
|
78
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
79
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
80
|
+
* @param issue is the security's issue date, expressed as a serial date number.
|
|
81
|
+
* @param rate is the interest rate.
|
|
82
|
+
* @param yld is the security's annual yield.
|
|
83
|
+
* @param basis is the type of day count basis to use.
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* The doc's `(100 + DIM/B·rate·100) / (1 + DSM/B·yld) − A/B·rate·100`, measured against Excel
|
|
87
|
+
* 16.0 (fn-battery financial/PRICEMAT, 2026-08-28) with the counts {@link readMatArgs}
|
|
88
|
+
* describes (DSM is `DIM − A`); a coupon term that overflows is 0, so a rate of 1E307 prices
|
|
89
|
+
* the redemption alone.
|
|
90
|
+
*/
|
|
91
|
+
export declare function PRICEMAT(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, issue: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, yld: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the annual yield of a security that pays interest at maturity.
|
|
94
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
95
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
96
|
+
* @param issue is the security's issue date, expressed as a serial date number.
|
|
97
|
+
* @param rate is the interest rate.
|
|
98
|
+
* @param pr is the security's price per $100 face value.
|
|
99
|
+
* @param basis is the type of day count basis to use.
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* PRICEMAT inverted in closed form, `((1 + DIM/B·rate) / (pr/100 + A/B·rate) − 1) / (DSM/B)`,
|
|
103
|
+
* measured against Excel 16.0 (fn-battery financial/YIELDMAT, 2026-08-28) with the counts
|
|
104
|
+
* {@link readMatArgs} describes.
|
|
105
|
+
*/
|
|
106
|
+
export declare function YIELDMAT(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, issue: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
107
|
+
//# sourceMappingURL=SecurityMaturity.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AcceptError, Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the price per $100 face value for a treasury bill.
|
|
4
|
+
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
5
|
+
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
6
|
+
* @param discount is the Treasury bill's discount rate.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* `100·(1 − discount·days/360)`, measured against Excel 16.0 (fn-battery financial/TBILLPRICE,
|
|
10
|
+
* 2026-08-28): a negative price is #NUM!, and a `discount·days` that overflows is 0 (a price of
|
|
11
|
+
* 100). The arguments read as {@link readTbillArgs} describes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function TBILLPRICE(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, discount: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the yield for a treasury bill.
|
|
16
|
+
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
17
|
+
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
18
|
+
* @param pr is the Treasury Bill's price per $100 face value.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* `(100 − pr)/pr · 360/days`, measured against Excel 16.0 (fn-battery financial/TBILLYIELD,
|
|
22
|
+
* 2026-08-28); a price above 100 is a negative yield. The arguments read as
|
|
23
|
+
* {@link readTbillArgs} describes.
|
|
24
|
+
*/
|
|
25
|
+
export declare function TBILLYIELD(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the bond-equivalent yield for a treasury bill.
|
|
28
|
+
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
29
|
+
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
30
|
+
* @param discount is the Treasury bill's discount rate.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Measured against Excel 16.0 (fn-battery financial/TBILLEQ, 2026-08-28). Through 182 days the
|
|
34
|
+
* doc's `365·discount / (360 − discount·days)`; from 183 days the Treasury's bond-equivalent
|
|
35
|
+
* quadratic on the discounted price, over a 365-day year — 366 for a 366-day span. A
|
|
36
|
+
* denominator at or below zero is #NUM!; a product that overflows is 0. The arguments read as
|
|
37
|
+
* {@link readTbillArgs} describes.
|
|
38
|
+
*/
|
|
39
|
+
export declare function TBILLEQ(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, discount: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
40
|
+
//# sourceMappingURL=TBill.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Returns the depreciation of an asset for any period you specify, including partial periods, using the double-declining balance method or some other method you specify.
|
|
3
3
|
* @param cost is the initial cost of the asset.
|
|
4
4
|
* @param salvage is the salvage value at the end of the life of the asset.
|
|
5
5
|
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
@@ -9,19 +9,21 @@
|
|
|
9
9
|
* @param noSwitch switch to straight-line depreciation when depreciation is greater than the declining balance = FALSE; do not switch = TRUE.
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
|
-
*
|
|
13
|
-
* some other method you specify.
|
|
12
|
+
* Measured against Excel 16.0 (fn-battery financial/VDB and `adhoc-vdb-clamp`, 2026-08-28).
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* • supporting any factor (not just 2)
|
|
18
|
-
* • optionally switching to straight-line when SL > DDB (noSwitch=FALSE)
|
|
14
|
+
* `no_switch = TRUE` is DDB period by period from the original cost, the first and last periods
|
|
15
|
+
* pro-rated by the fraction of them inside the window.
|
|
19
16
|
*
|
|
20
|
-
* The `
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* With the switch, Excel runs two passes. The first walks from 0 to `start` to find the balance
|
|
18
|
+
* there — the FRACTIONAL part of `start` first (a partial period charged as `raw·fraction`,
|
|
19
|
+
* clamped at salvage and never negative), then whole periods with the straight-line switch, each
|
|
20
|
+
* period's straight line measured against the life remaining at that point (so a start of 2.5
|
|
21
|
+
* or 6.5 switches on the same `[1.5, 2.5]` period). The second pass depreciates that balance over
|
|
22
|
+
* `end − start` periods with a remaining life of `life − start`, each period's declining-balance
|
|
23
|
+
* charge clamped at salvage (then pro-rated if partial), switching to straight-line when that is
|
|
24
|
+
* larger. The second pass is NOT floored at zero: an asset already below salvage is written UP
|
|
25
|
+
* to it in its first period (VDB(300,2400,10,0,1) is −2100), which is also why a whole-period
|
|
26
|
+
* start on such an asset is 0 — the first pass has already moved the balance to salvage.
|
|
23
27
|
*/
|
|
24
|
-
export declare function VDB(cost: number, salvage: number, life: number, startPeriod: number,
|
|
25
|
-
endPeriod: number, // date
|
|
26
|
-
factor?: number, noSwitch?: boolean): number;
|
|
28
|
+
export declare function VDB(cost: number, salvage: number, life: number, startPeriod: number, endPeriod: number, factor?: number, noSwitch?: boolean): number;
|
|
27
29
|
//# sourceMappingURL=VDB.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AcceptError, IRange, Omittable } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* Aggregate values by row fields.
|
|
4
|
+
* @param rowFields The range or array containing the row fields.
|
|
5
|
+
* @param values The range or array containing the values to aggregate.
|
|
6
|
+
* @param fn The function used to do the aggregations: a LAMBDA, a function name such as SUM, or an array of them.
|
|
7
|
+
* @param fieldHeaders A number between 0 and 3 that specifies whether the field data has headers and whether field headers should be returned in the results.
|
|
8
|
+
* @param totalDepth Show totals for the row fields. 0 for none, 1 for grand totals, 2 for grand total and first level subtotals, etc. A negative number shows them at the top.
|
|
9
|
+
* @param sortOrder The column index to sort the row fields on. A negative index will sort in reverse order.
|
|
10
|
+
* @param filterArray An array of boolean where TRUE represents a row to retain.
|
|
11
|
+
* @param fieldRelationship The relationship of fields when multiple columns are supplied to the rowFields argument. 0 for hierarchy, 1 for table.
|
|
12
|
+
*/
|
|
13
|
+
export declare function GROUPBY(rowFields: IRange, values: IRange, fn: AcceptError<any>, fieldHeaders?: Omittable<number>, totalDepth?: Omittable<number>, sortOrder?: Omittable<IRange>, filterArray?: Omittable<IRange>, fieldRelationship?: Omittable<number>): IRange;
|
|
14
|
+
//# sourceMappingURL=GroupBy.d.ts.map
|