@sheetxl/formulas-extended 0.8.0-beta.11 → 0.8.0-beta.13
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/{node/esm/D25GpXzrju6GyQn2.mjs → browser/esm/-gjh-c5r-kqWZw9o.mjs} +1 -1
- package/{node/esm/D0XFBj8GRIDAu37v.mjs → browser/esm/B6ojJF7WA6DiQR2T.mjs} +1 -1
- package/browser/esm/{Bf0x5wP966yEyeU1.mjs → BHd0M_vc0wMVhN4M.mjs} +1 -1
- package/browser/esm/{D4kfW2yw0rsWNLi0.mjs → Bp7v8eImXSaAUiaa.mjs} +1 -1
- package/browser/esm/{CjKII1gh4dO5nTCs.mjs → BuGd_WozQ5GACryc.mjs} +1 -1
- package/browser/esm/{cfrOLasJbMwF7L77.mjs → BzsAYB0O4AGQyHhT.mjs} +1 -1
- package/browser/esm/{B0dkCLIUbDz5vaVn.mjs → C5QRZhBj0R2s5scX.mjs} +1 -1
- package/browser/esm/{0yxQHUFt5rjQCIev.mjs → C8cZUVI0utH84RoY.mjs} +1 -1
- package/browser/esm/{qAolCiBy-hQL59hu.mjs → CYYsvsWpauQOJMsM.mjs} +1 -1
- package/browser/esm/{CoHdir1CxZhcwJYt.mjs → D23E5LzPcseeh6hA.mjs} +1 -1
- package/{node/esm/o8LeKZ4-9nq29pqg.mjs → browser/esm/D5YXRS6-9JR6Jnuy.mjs} +1 -1
- package/browser/esm/{zWOO2QFn-kMYJv1L.mjs → DRA4FqoQ1dJXOyPu.mjs} +1 -1
- package/{node/esm/BJjZHVPRHerJoONT.mjs → browser/esm/DvQaVDnNxRMcD29t.mjs} +1 -1
- package/browser/esm/{g4CKPtGz1NpGDtQq.mjs → DygYeEKVAggDDD_C.mjs} +12 -41
- package/browser/esm/{BfcYyyl5rbLdyDeQ.mjs → JeU0hWKFq05N2_wk.mjs} +1 -1
- package/{node/esm/CNDVQpzD85y-8iJ4.mjs → browser/esm/KELE0bwOYLDc5LU1.mjs} +1 -1
- package/{node/esm/CZ7GTErfSkfNcFRk.mjs → browser/esm/N6ZNg1DcQqnCub6Y.mjs} +1 -1
- package/{node/esm/Dt0ErrS3YGvCicxr.mjs → browser/esm/NLoLzdQXAOTuwqvv.mjs} +1 -1
- package/{node/esm/DXTaMRX8ten_8WHT.mjs → browser/esm/P2KKIUxWzaRqA578.mjs} +1 -1
- package/browser/esm/{CiTyrOKe-UEYKcPV.mjs → TsVRWlV0aBAj11q_.mjs} +1 -1
- package/browser/esm/declarations.mjs +24 -28
- package/browser/esm/index.mjs +836 -844
- package/{node/esm/D4ySsDPVL4IH96en.mjs → browser/esm/kHBrNyVWu-GLkTFD.mjs} +1 -1
- package/browser/esm/{C2ZfbEIW-6-61CUe.mjs → pEF9hsQQaka-GGnX.mjs} +1 -1
- package/{browser/esm/D25GpXzrju6GyQn2.mjs → node/esm/-gjh-c5r-kqWZw9o.mjs} +1 -1
- package/{browser/esm/D0XFBj8GRIDAu37v.mjs → node/esm/B6ojJF7WA6DiQR2T.mjs} +1 -1
- package/node/esm/{Bf0x5wP966yEyeU1.mjs → BHd0M_vc0wMVhN4M.mjs} +1 -1
- package/node/esm/{C3Qy2cWt_qACxJiF.mjs → BVcZk6dCLKI8-HRM.mjs} +1 -1
- package/node/esm/{CgY5V9Cmm0UJmyGW.mjs → BbUWXLsnVo-QSDn_.mjs} +12 -41
- package/node/esm/{D4kfW2yw0rsWNLi0.mjs → Bp7v8eImXSaAUiaa.mjs} +1 -1
- package/node/esm/{CjKII1gh4dO5nTCs.mjs → BuGd_WozQ5GACryc.mjs} +1 -1
- package/node/esm/{cfrOLasJbMwF7L77.mjs → BzsAYB0O4AGQyHhT.mjs} +1 -1
- package/node/esm/{B0dkCLIUbDz5vaVn.mjs → C5QRZhBj0R2s5scX.mjs} +1 -1
- package/node/esm/{0yxQHUFt5rjQCIev.mjs → C8cZUVI0utH84RoY.mjs} +1 -1
- package/node/esm/{qAolCiBy-hQL59hu.mjs → CYYsvsWpauQOJMsM.mjs} +1 -1
- package/{browser/esm/o8LeKZ4-9nq29pqg.mjs → node/esm/D5YXRS6-9JR6Jnuy.mjs} +1 -1
- package/{browser/esm/BJjZHVPRHerJoONT.mjs → node/esm/DvQaVDnNxRMcD29t.mjs} +1 -1
- package/node/esm/{Bnco0vB0yNDiLGre.mjs → FxwjPPWZTalxCLby.mjs} +1 -1
- package/node/esm/{BfcYyyl5rbLdyDeQ.mjs → JeU0hWKFq05N2_wk.mjs} +1 -1
- package/{browser/esm/CNDVQpzD85y-8iJ4.mjs → node/esm/KELE0bwOYLDc5LU1.mjs} +1 -1
- package/{browser/esm/CZ7GTErfSkfNcFRk.mjs → node/esm/N6ZNg1DcQqnCub6Y.mjs} +1 -1
- package/{browser/esm/Dt0ErrS3YGvCicxr.mjs → node/esm/NLoLzdQXAOTuwqvv.mjs} +1 -1
- package/{browser/esm/DXTaMRX8ten_8WHT.mjs → node/esm/P2KKIUxWzaRqA578.mjs} +1 -1
- package/node/esm/{CiTyrOKe-UEYKcPV.mjs → TsVRWlV0aBAj11q_.mjs} +1 -1
- package/node/esm/declarations.mjs +24 -28
- package/node/esm/index.mjs +894 -902
- package/{browser/esm/D4ySsDPVL4IH96en.mjs → node/esm/kHBrNyVWu-GLkTFD.mjs} +1 -1
- package/node/esm/{C2ZfbEIW-6-61CUe.mjs → pEF9hsQQaka-GGnX.mjs} +1 -1
- package/package.json +3 -3
- package/types/src/_utils/AnyArgs.d.ts +0 -12
- package/types/src/_utils/FinanaceSolver.d.ts +0 -27
- package/types/src/_utils/FinanceAmor.d.ts +0 -9
- package/types/src/_utils/FinanceCashflow.d.ts +0 -17
- package/types/src/_utils/FinanceCoupon.d.ts +0 -63
- package/types/src/_utils/FinanceDate.d.ts +0 -7
- package/types/src/_utils/FinanceDayCount.d.ts +0 -74
- package/types/src/_utils/FinanceOdd.d.ts +0 -62
- package/types/src/_utils/FinanceSecurity.d.ts +0 -21
- package/types/src/_utils/FinanceUtils.d.ts +0 -34
- package/types/src/cube/Cube.d.ts +7 -7
- package/types/src/financial/ACCRINT.d.ts +0 -23
- package/types/src/financial/AMORDEGRC.d.ts +0 -22
- package/types/src/financial/Cashflow.d.ts +0 -49
- package/types/src/financial/Coupon.d.ts +0 -14
- package/types/src/financial/Date.d.ts +0 -29
- package/types/src/financial/Depreciation.d.ts +0 -9
- package/types/src/financial/Odd.d.ts +0 -18
- package/types/src/financial/Security.d.ts +0 -10
- package/types/src/financial/SecurityMaturity.d.ts +0 -40
- package/types/src/financial/TBill.d.ts +0 -17
- package/types/src/financial/VDB.d.ts +0 -17
- package/browser/esm/BDiwqEqe9Jl-Rmly.mjs +0 -19
- package/node/esm/0vsGDvrSkTeFOp0A.mjs +0 -19
- package/types/src/.generated/decl/financial/STOCKHISTORY.decl.d.ts +0 -4
- package/types/src/.generated/desc/financial/STOCKHISTORY.desc.d.ts +0 -4
- package/types/src/financial/STOCKHISTORY.d.ts +0 -17
|
@@ -9,17 +9,6 @@ export declare function NPV(rate: number, value: IRange<number>[]): number;
|
|
|
9
9
|
* Returns the internal rate of return for a series of cash flows.
|
|
10
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
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
12
|
*/
|
|
24
13
|
export declare function IRR(values: Omittable<Flatten<AcceptError<Scalar>>>, guess?: number): number;
|
|
25
14
|
/**
|
|
@@ -27,19 +16,6 @@ export declare function IRR(values: Omittable<Flatten<AcceptError<Scalar>>>, gue
|
|
|
27
16
|
* @param values An array of cash flows; must contain at least one positive and one negative value.
|
|
28
17
|
* @param financeRate The interest rate paid on negative cash flows (cost of capital).
|
|
29
18
|
* @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
19
|
*/
|
|
44
20
|
export declare function MIRR(values: Omittable<Flatten<AcceptError<Scalar>>>, financeRate: number, reinvestRate: number): number;
|
|
45
21
|
/**
|
|
@@ -47,14 +23,6 @@ export declare function MIRR(values: Omittable<Flatten<AcceptError<Scalar>>>, fi
|
|
|
47
23
|
* @param rate is the discount rate to apply to the cash flows.
|
|
48
24
|
* @param values is a series of cash flows that correspond to a schedule of payments in dates.
|
|
49
25
|
* @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
26
|
*/
|
|
59
27
|
export declare function XNPV(rate: NoLift<Omittable<Scalar>>, values: Omittable<IRange>, dates: Omittable<IRange>): number;
|
|
60
28
|
/**
|
|
@@ -62,23 +30,6 @@ export declare function XNPV(rate: NoLift<Omittable<Scalar>>, values: Omittable<
|
|
|
62
30
|
* @param values is a series of cash flows that correspond to a schedule of payments in dates.
|
|
63
31
|
* @param dates is a schedule of payment dates that corresponds to the cash flow payments.
|
|
64
32
|
* @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
33
|
*/
|
|
83
34
|
export declare function XIRR(values: Omittable<IRange>, dates: Omittable<IRange>, guess?: NoLift<Omittable<Scalar>>): number;
|
|
84
35
|
//# sourceMappingURL=Cashflow.d.ts.map
|
|
@@ -1,12 +1,4 @@
|
|
|
1
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
2
|
/**
|
|
11
3
|
* Returns the number of days from the beginning of the coupon period to the settlement date.
|
|
12
4
|
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
@@ -37,12 +29,6 @@ export declare function COUPDAYSNC(settlement: NoLift<Omittable<Scalar>>, maturi
|
|
|
37
29
|
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
38
30
|
* @param frequency is the number of coupon payments per year.
|
|
39
31
|
* @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
32
|
*/
|
|
47
33
|
export declare function COUPNCD(settlement: NoLift<Omittable<Scalar>>, maturity: NoLift<Omittable<Scalar>>, frequency: NoLift<Omittable<Scalar>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
48
34
|
/**
|
|
@@ -5,17 +5,6 @@ import { AcceptError, Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
|
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.
|
|
19
8
|
*/
|
|
20
9
|
export declare function DATEDIF(startDate: number, // Date
|
|
21
10
|
endDate: number, // Date
|
|
@@ -26,17 +15,6 @@ unit: string): number;
|
|
|
26
15
|
* @param endDate is a serial date number that represents the end date.
|
|
27
16
|
* @param basis is the type of day count basis to use.
|
|
28
17
|
* @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.
|
|
40
18
|
*/
|
|
41
19
|
export declare function YEARFRAC(startDate: NoLift<Omittable<AcceptError<Scalar>>>, endDate: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<Scalar>>): number;
|
|
42
20
|
/**
|
|
@@ -44,13 +22,6 @@ export declare function YEARFRAC(startDate: NoLift<Omittable<AcceptError<Scalar>
|
|
|
44
22
|
* @param endDate startDate and endDate are the two dates between which you want to know the number of days.
|
|
45
23
|
* @param startDate startDate and endDate are the two dates between which you want to know the number of days.
|
|
46
24
|
* @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.
|
|
54
25
|
*/
|
|
55
26
|
export declare function DAYS360(startDate: number, // date
|
|
56
27
|
endDate: number, // date
|
|
@@ -44,15 +44,6 @@ export declare function DDB(cost: number, salvage: number, life: number, period:
|
|
|
44
44
|
* @param period is the period.
|
|
45
45
|
* @param rate is the rate of depreciation.
|
|
46
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
47
|
*/
|
|
57
48
|
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
49
|
//# sourceMappingURL=Depreciation.d.ts.map
|
|
@@ -10,16 +10,6 @@ import { AcceptError, Omittable, Scalar, NoLift } from '@sheetxl/primitives';
|
|
|
10
10
|
* @param redemption is the security's redemption value per $100 face value.
|
|
11
11
|
* @param frequency is the number of coupon payments per year.
|
|
12
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
13
|
*/
|
|
24
14
|
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
15
|
/**
|
|
@@ -50,14 +40,6 @@ export declare function ODDFYIELD(settlement: NoLift<Omittable<AcceptError<Scala
|
|
|
50
40
|
* @param redemption is the amount to be received at maturity.
|
|
51
41
|
* @param frequency is the number of coupon payments per year.
|
|
52
42
|
* @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
43
|
*/
|
|
62
44
|
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
45
|
/**
|
|
@@ -53,16 +53,6 @@ export declare function MDURATION(settlement: NoLift<Omittable<AcceptError<Scala
|
|
|
53
53
|
* @param redemption is the security's redemption value per $100 face value.
|
|
54
54
|
* @param frequency is the number of coupon payments per year.
|
|
55
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
56
|
*/
|
|
67
57
|
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
58
|
//# sourceMappingURL=Security.d.ts.map
|
|
@@ -6,13 +6,6 @@ import { AcceptError, Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
|
6
6
|
* @param pr is the security's price per $100 face value.
|
|
7
7
|
* @param redemption is the security's redemption value per $100 face value.
|
|
8
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
9
|
*/
|
|
17
10
|
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
11
|
/**
|
|
@@ -22,12 +15,6 @@ export declare function DISC(settlement: NoLift<Omittable<AcceptError<Scalar>>>,
|
|
|
22
15
|
* @param discount is the security's discount rate.
|
|
23
16
|
* @param redemption is the amount to be received at maturity.
|
|
24
17
|
* @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
18
|
*/
|
|
32
19
|
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
20
|
/**
|
|
@@ -37,11 +24,6 @@ export declare function PRICEDISC(settlement: NoLift<Omittable<AcceptError<Scala
|
|
|
37
24
|
* @param pr is the security's price per $100 face value.
|
|
38
25
|
* @param redemption is the security's redemption value per $100 face value.
|
|
39
26
|
* @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
27
|
*/
|
|
46
28
|
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
29
|
/**
|
|
@@ -51,11 +33,6 @@ export declare function YIELDDISC(settlement: NoLift<Omittable<AcceptError<Scala
|
|
|
51
33
|
* @param investment is the amount invested in the security.
|
|
52
34
|
* @param redemption is the amount to be received at maturity.
|
|
53
35
|
* @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
36
|
*/
|
|
60
37
|
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
38
|
/**
|
|
@@ -65,12 +42,6 @@ export declare function INTRATE(settlement: NoLift<Omittable<AcceptError<Scalar>
|
|
|
65
42
|
* @param investment is the amount invested in the security.
|
|
66
43
|
* @param discount is the security's discount rate.
|
|
67
44
|
* @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
45
|
*/
|
|
75
46
|
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
47
|
/**
|
|
@@ -81,12 +52,6 @@ export declare function RECEIVED(settlement: NoLift<Omittable<AcceptError<Scalar
|
|
|
81
52
|
* @param rate is the interest rate.
|
|
82
53
|
* @param yld is the security's annual yield.
|
|
83
54
|
* @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
55
|
*/
|
|
91
56
|
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
57
|
/**
|
|
@@ -97,11 +62,6 @@ export declare function PRICEMAT(settlement: NoLift<Omittable<AcceptError<Scalar
|
|
|
97
62
|
* @param rate is the interest rate.
|
|
98
63
|
* @param pr is the security's price per $100 face value.
|
|
99
64
|
* @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
65
|
*/
|
|
106
66
|
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
67
|
//# sourceMappingURL=SecurityMaturity.d.ts.map
|
|
@@ -4,11 +4,6 @@ import { AcceptError, Scalar, Omittable, NoLift } from '@sheetxl/primitives';
|
|
|
4
4
|
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
5
5
|
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
6
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
7
|
*/
|
|
13
8
|
export declare function TBILLPRICE(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, discount: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
14
9
|
/**
|
|
@@ -16,11 +11,6 @@ export declare function TBILLPRICE(settlement: NoLift<Omittable<AcceptError<Scal
|
|
|
16
11
|
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
17
12
|
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
18
13
|
* @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
14
|
*/
|
|
25
15
|
export declare function TBILLYIELD(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, pr: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
26
16
|
/**
|
|
@@ -28,13 +18,6 @@ export declare function TBILLYIELD(settlement: NoLift<Omittable<AcceptError<Scal
|
|
|
28
18
|
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
29
19
|
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
30
20
|
* @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
21
|
*/
|
|
39
22
|
export declare function TBILLEQ(settlement: NoLift<Omittable<AcceptError<Scalar>>>, maturity: NoLift<Omittable<AcceptError<Scalar>>>, discount: NoLift<Omittable<AcceptError<Scalar>>>): number;
|
|
40
23
|
//# sourceMappingURL=TBill.d.ts.map
|
|
@@ -7,23 +7,6 @@
|
|
|
7
7
|
* @param endPeriod is the last period in the calculation.
|
|
8
8
|
* @param factor is the rate at which the balance declines.
|
|
9
9
|
* @param noSwitch switch to straight-line depreciation when depreciation is greater than the declining balance = FALSE; do not switch = TRUE.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* Measured against Excel 16.0 (fn-battery financial/VDB and `adhoc-vdb-clamp`, 2026-08-28).
|
|
13
|
-
*
|
|
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.
|
|
16
|
-
*
|
|
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.
|
|
27
10
|
*/
|
|
28
11
|
export declare function VDB(cost: number, salvage: number, life: number, startPeriod: number, endPeriod: number, factor?: number, noSwitch?: boolean): number;
|
|
29
12
|
//# sourceMappingURL=VDB.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
var e = { STOCKHISTORY: {
|
|
8
|
-
s: "Returns an array of historical quote data for a symbol and date range you specify..",
|
|
9
|
-
p: {
|
|
10
|
-
stock: { d: "Symbol of financial instrument to be considered or a Stock data type." },
|
|
11
|
-
startDate: { d: "First date to return data from." },
|
|
12
|
-
endDate: { d: "Last date to return data from." },
|
|
13
|
-
interval: { d: "A number indicating the granularity of the data; 0 - Daily, 1 - Weekly, 2 - Monthly." },
|
|
14
|
-
headers: { d: "A logical value to add column header data; 0 - No column header, 1 - Show column header, 2 - Show instrument identifier and column header." },
|
|
15
|
-
properties: { d: "A number indicating which column of data to return; 0 through 5." }
|
|
16
|
-
},
|
|
17
|
-
h: "Unimplemented RichData"
|
|
18
|
-
} };
|
|
19
|
-
export { e as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
var a = { STOCKHISTORY: {
|
|
8
|
-
s: "Returns an array of historical quote data for a symbol and date range you specify..",
|
|
9
|
-
p: {
|
|
10
|
-
stock: { d: "Symbol of financial instrument to be considered or a Stock data type." },
|
|
11
|
-
startDate: { d: "First date to return data from." },
|
|
12
|
-
endDate: { d: "Last date to return data from." },
|
|
13
|
-
interval: { d: "A number indicating the granularity of the data; 0 - Daily, 1 - Weekly, 2 - Monthly." },
|
|
14
|
-
headers: { d: "A logical value to add column header data; 0 - No column header, 1 - Show column header, 2 - Show instrument identifier and column header." },
|
|
15
|
-
properties: { d: "A number indicating which column of data to return; 0 through 5." }
|
|
16
|
-
},
|
|
17
|
-
h: "Unimplemented RichData"
|
|
18
|
-
} };
|
|
19
|
-
export { a as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|