@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.
Files changed (142) hide show
  1. package/browser/esm/0yxQHUFt5rjQCIev.mjs +32 -0
  2. package/browser/esm/B0dkCLIUbDz5vaVn.mjs +37 -0
  3. package/browser/esm/BDiwqEqe9Jl-Rmly.mjs +19 -0
  4. package/browser/esm/BJjZHVPRHerJoONT.mjs +33 -0
  5. package/{node/esm/COqdI1LYTHd9oLA6.mjs → browser/esm/Bf0x5wP966yEyeU1.mjs} +1 -1
  6. package/browser/esm/BfcYyyl5rbLdyDeQ.mjs +58 -0
  7. package/{node/esm/srpVt74r2zbvm1N0.mjs → browser/esm/C2ZfbEIW-6-61CUe.mjs} +5 -5
  8. package/browser/esm/{BuGemmv84T8m0wqw.mjs → CNDVQpzD85y-8iJ4.mjs} +1 -1
  9. package/browser/esm/CZ7GTErfSkfNcFRk.mjs +32 -0
  10. package/browser/esm/CiTyrOKe-UEYKcPV.mjs +47 -0
  11. package/browser/esm/CjKII1gh4dO5nTCs.mjs +119 -0
  12. package/browser/esm/{DY3kG36QGyDbrANO.mjs → CoHdir1CxZhcwJYt.mjs} +1 -1
  13. package/browser/esm/D0XFBj8GRIDAu37v.mjs +20 -0
  14. package/{node/esm/DodhOXkSzelSxHmB.mjs → browser/esm/D25GpXzrju6GyQn2.mjs} +27 -29
  15. package/browser/esm/{DpoZ7h1ScIJvbOY9.mjs → D4kfW2yw0rsWNLi0.mjs} +5 -5
  16. package/{node/esm/vu0NRDeeTbEHPMYS.mjs → browser/esm/D4ySsDPVL4IH96en.mjs} +2 -2
  17. package/{node/esm/CnVJ8GAsshRjRGA-.mjs → browser/esm/DXTaMRX8ten_8WHT.mjs} +2 -2
  18. package/browser/esm/{B1VmvhXuEn7zaTB9.mjs → Dt0ErrS3YGvCicxr.mjs} +1 -1
  19. package/{node/esm/BRwwvGaJ6HvkxjFC.mjs → browser/esm/cfrOLasJbMwF7L77.mjs} +1 -1
  20. package/browser/esm/declarations.mjs +99 -0
  21. package/browser/esm/g4CKPtGz1NpGDtQq.mjs +2449 -0
  22. package/browser/esm/index.mjs +2281 -2585
  23. package/browser/esm/o8LeKZ4-9nq29pqg.mjs +23 -0
  24. package/{node/esm/Bma3CN4_Nec6_4n7.mjs → browser/esm/qAolCiBy-hQL59hu.mjs} +6 -6
  25. package/browser/esm/{BFnDPCjxJcoIItFa.mjs → zWOO2QFn-kMYJv1L.mjs} +3 -3
  26. package/node/esm/0vsGDvrSkTeFOp0A.mjs +19 -0
  27. package/node/esm/0yxQHUFt5rjQCIev.mjs +32 -0
  28. package/node/esm/B0dkCLIUbDz5vaVn.mjs +37 -0
  29. package/node/esm/BJjZHVPRHerJoONT.mjs +33 -0
  30. package/{browser/esm/COqdI1LYTHd9oLA6.mjs → node/esm/Bf0x5wP966yEyeU1.mjs} +1 -1
  31. package/node/esm/BfcYyyl5rbLdyDeQ.mjs +58 -0
  32. package/node/esm/{LAkTk93odAfpvx50.mjs → Bnco0vB0yNDiLGre.mjs} +1 -1
  33. package/{browser/esm/srpVt74r2zbvm1N0.mjs → node/esm/C2ZfbEIW-6-61CUe.mjs} +5 -5
  34. package/node/esm/{BQyZVLTMNFLbjVap.mjs → C3Qy2cWt_qACxJiF.mjs} +3 -3
  35. package/node/esm/{BuGemmv84T8m0wqw.mjs → CNDVQpzD85y-8iJ4.mjs} +1 -1
  36. package/node/esm/CZ7GTErfSkfNcFRk.mjs +32 -0
  37. package/node/esm/CgY5V9Cmm0UJmyGW.mjs +2449 -0
  38. package/node/esm/CiTyrOKe-UEYKcPV.mjs +47 -0
  39. package/node/esm/CjKII1gh4dO5nTCs.mjs +119 -0
  40. package/node/esm/D0XFBj8GRIDAu37v.mjs +20 -0
  41. package/{browser/esm/DodhOXkSzelSxHmB.mjs → node/esm/D25GpXzrju6GyQn2.mjs} +27 -29
  42. package/node/esm/{DpoZ7h1ScIJvbOY9.mjs → D4kfW2yw0rsWNLi0.mjs} +5 -5
  43. package/{browser/esm/vu0NRDeeTbEHPMYS.mjs → node/esm/D4ySsDPVL4IH96en.mjs} +2 -2
  44. package/{browser/esm/CnVJ8GAsshRjRGA-.mjs → node/esm/DXTaMRX8ten_8WHT.mjs} +2 -2
  45. package/node/esm/{B1VmvhXuEn7zaTB9.mjs → Dt0ErrS3YGvCicxr.mjs} +1 -1
  46. package/{browser/esm/BRwwvGaJ6HvkxjFC.mjs → node/esm/cfrOLasJbMwF7L77.mjs} +1 -1
  47. package/node/esm/declarations.mjs +99 -0
  48. package/node/esm/index.mjs +2551 -2837
  49. package/node/esm/o8LeKZ4-9nq29pqg.mjs +23 -0
  50. package/{browser/esm/Bma3CN4_Nec6_4n7.mjs → node/esm/qAolCiBy-hQL59hu.mjs} +6 -6
  51. package/package.json +11 -6
  52. package/types/declarations.d.ts +4 -0
  53. package/types/src/.generated/decl/financial/Annuity.decl.d.ts +5 -0
  54. package/types/src/.generated/decl/financial/{Financial.decl.d.ts → Cashflow.decl.d.ts} +1 -1
  55. package/types/src/.generated/decl/financial/Convert.decl.d.ts +4 -0
  56. package/types/src/.generated/decl/financial/Coupon.decl.d.ts +4 -0
  57. package/types/src/.generated/decl/financial/{Financial2.decl.d.ts → Depreciation.decl.d.ts} +1 -1
  58. package/types/src/.generated/decl/financial/Growth.decl.d.ts +4 -0
  59. package/types/src/.generated/decl/financial/{ODD.decl.d.ts → Odd.decl.d.ts} +1 -1
  60. package/types/src/.generated/decl/financial/{Financial3.decl.d.ts → STOCKHISTORY.decl.d.ts} +1 -1
  61. package/types/src/.generated/decl/financial/Security.decl.d.ts +4 -0
  62. package/types/src/.generated/decl/financial/{Financial4.decl.d.ts → SecurityMaturity.decl.d.ts} +1 -1
  63. package/types/src/.generated/decl/{statistical/TTEST.decl.d.ts → financial/TBill.decl.d.ts} +1 -1
  64. package/types/src/.generated/decl/lookupReference/GroupBy.decl.d.ts +4 -0
  65. package/types/src/.generated/decl/lookupReference/PivotBy.decl.d.ts +4 -0
  66. package/types/src/.generated/decl/statistical/{ETS.decl.d.ts → Ets.decl.d.ts} +1 -1
  67. package/types/src/.generated/decl/statistical/TTest.decl.d.ts +4 -0
  68. package/types/src/.generated/declarations.d.ts +7 -0
  69. package/types/src/.generated/desc/financial/Annuity.desc.d.ts +5 -0
  70. package/types/src/.generated/desc/financial/{Financial.desc.d.ts → Cashflow.desc.d.ts} +1 -1
  71. package/types/src/.generated/desc/financial/Convert.desc.d.ts +4 -0
  72. package/types/src/.generated/desc/financial/Coupon.desc.d.ts +4 -0
  73. package/types/src/.generated/desc/financial/{Financial2.desc.d.ts → Depreciation.desc.d.ts} +1 -1
  74. package/types/src/.generated/desc/financial/Growth.desc.d.ts +4 -0
  75. package/types/src/.generated/desc/financial/{ODD.desc.d.ts → Odd.desc.d.ts} +1 -1
  76. package/types/src/.generated/desc/financial/{Financial3.desc.d.ts → STOCKHISTORY.desc.d.ts} +1 -1
  77. package/types/src/.generated/desc/financial/Security.desc.d.ts +4 -0
  78. package/types/src/.generated/desc/financial/{Financial4.desc.d.ts → SecurityMaturity.desc.d.ts} +1 -1
  79. package/types/src/.generated/desc/{statistical/TTEST.desc.d.ts → financial/TBill.desc.d.ts} +1 -1
  80. package/types/src/.generated/desc/lookupReference/GroupBy.desc.d.ts +4 -0
  81. package/types/src/.generated/desc/lookupReference/PivotBy.desc.d.ts +4 -0
  82. package/types/src/.generated/desc/statistical/{ETS.desc.d.ts → Ets.desc.d.ts} +1 -1
  83. package/types/src/.generated/desc/statistical/TTest.desc.d.ts +4 -0
  84. package/types/src/_utils/AnyArgs.d.ts +17 -3
  85. package/types/src/_utils/FinanaceSolver.d.ts +39 -2
  86. package/types/src/_utils/FinanceAmor.d.ts +23 -0
  87. package/types/src/_utils/FinanceCashflow.d.ts +42 -0
  88. package/types/src/_utils/FinanceCoupon.d.ts +92 -82
  89. package/types/src/_utils/FinanceDate.d.ts +24 -0
  90. package/types/src/_utils/FinanceDayCount.d.ts +46 -0
  91. package/types/src/_utils/FinanceOdd.d.ts +93 -0
  92. package/types/src/_utils/FinanceSecurity.d.ts +84 -0
  93. package/types/src/_utils/FinanceUtils.d.ts +37 -1
  94. package/types/src/_utils/LeastSquares.d.ts +20 -22
  95. package/types/src/_utils/Pivot.d.ts +205 -0
  96. package/types/src/_utils/RegexCompile.d.ts +33 -0
  97. package/types/src/cube/Cube.d.ts +7 -7
  98. package/types/src/financial/ACCRINT.d.ts +33 -6
  99. package/types/src/financial/AMORDEGRC.d.ts +22 -40
  100. package/types/src/financial/Annuity.d.ts +118 -0
  101. package/types/src/financial/Cashflow.d.ts +84 -0
  102. package/types/src/financial/Convert.d.ts +26 -0
  103. package/types/src/financial/Coupon.d.ts +72 -0
  104. package/types/src/financial/Date.d.ts +34 -5
  105. package/types/src/financial/Depreciation.d.ts +58 -0
  106. package/types/src/financial/Growth.d.ts +22 -0
  107. package/types/src/financial/Odd.d.ts +82 -0
  108. package/types/src/financial/STOCKHISTORY.d.ts +17 -0
  109. package/types/src/financial/Security.d.ts +68 -0
  110. package/types/src/financial/SecurityMaturity.d.ts +107 -0
  111. package/types/src/financial/TBill.d.ts +40 -0
  112. package/types/src/financial/VDB.d.ts +15 -13
  113. package/types/src/lookupReference/GroupBy.d.ts +14 -0
  114. package/types/src/lookupReference/PivotBy.d.ts +17 -0
  115. package/types/src/statistical/{ETS.d.ts → Ets.d.ts} +14 -14
  116. package/types/src/statistical/Regression.d.ts +13 -18
  117. package/types/src/statistical/{TTEST.d.ts → TTest.d.ts} +5 -5
  118. package/types/src/text/RegEx.d.ts +34 -11
  119. package/browser/cjs/B4JJfKSI4ppwU855.cjs +0 -1
  120. package/browser/cjs/BWDfauDHqB6U_2ka.cjs +0 -1
  121. package/browser/cjs/BwLx9ix5Sq7suAYP.cjs +0 -1
  122. package/browser/cjs/C2uDl8VIJqh58YF_.cjs +0 -1
  123. package/browser/cjs/CW-b31_-r-_raT8Y.cjs +0 -1
  124. package/browser/cjs/Clu7XiAsCB48GDXN.cjs +0 -1
  125. package/browser/cjs/CnZfa45XxA-9Jhmp.cjs +0 -1
  126. package/browser/cjs/DsFZgtSQpC75d1M0.cjs +0 -1
  127. package/browser/cjs/JfM6P_qoQQTWakZf.cjs +0 -1
  128. package/browser/cjs/bM25C5avKgBAJVfk.cjs +0 -1
  129. package/browser/cjs/fqTQ_p3ehzUvc1tF.cjs +0 -1
  130. package/browser/cjs/h3dw1jAp2J5Pu4p3.cjs +0 -1
  131. package/browser/cjs/index.cjs +0 -1
  132. package/browser/cjs/jev6VGWTdgEgm4Yk.cjs +0 -1
  133. package/browser/cjs/lEQC21-Sk4lwHy2r.cjs +0 -1
  134. package/browser/esm/CwoMEzOtRihuYUTr.mjs +0 -20
  135. package/browser/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
  136. package/node/esm/CwoMEzOtRihuYUTr.mjs +0 -20
  137. package/node/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
  138. package/types/src/financial/Financial.d.ts +0 -288
  139. package/types/src/financial/Financial2.d.ts +0 -99
  140. package/types/src/financial/Financial3.d.ts +0 -95
  141. package/types/src/financial/Financial4.d.ts +0 -82
  142. package/types/src/financial/ODD.d.ts +0 -106
@@ -0,0 +1,205 @@
1
+ import { FormulaError, IFormulaContext, IFunction, IRange, Scalar } from '@sheetxl/primitives';
2
+ /**
3
+ * One aggregate column: a function applied to one value column.
4
+ */
5
+ export interface Measure {
6
+ readonly fn: IFunction;
7
+ /** The value column it reads. */
8
+ readonly column: number;
9
+ /** Called with `(x, y)` rather than `(x)` — see {@link aggregate}. */
10
+ readonly twoArgs: boolean;
11
+ /** What the function-name row shows. */
12
+ readonly label: string;
13
+ }
14
+ /**
15
+ * The function argument, resolved.
16
+ */
17
+ export interface Functions {
18
+ /** One per output column (or, when `vertical`, one per output row of each group). */
19
+ readonly measures: Measure[];
20
+ /** The functions were a column (`VSTACK(SUM,COUNT)`): each group gets one row per function. */
21
+ readonly vertical: boolean;
22
+ /** More than one function — a row or column names them. */
23
+ readonly named: boolean;
24
+ }
25
+ /**
26
+ * Resolves the function argument against the value columns, or answers the whole call's error.
27
+ *
28
+ * @remarks
29
+ * A row of functions is one column per function, a column of them one row per function (a13, a14),
30
+ * and a 2-D block is refused (a15). Functions pair with value columns one to many, many to one, or
31
+ * one to one (a37, a38, a42). A function that cannot take one argument, or needs more than two, is
32
+ * refused up front (a23, a24, a43) — the call shape is decided before any group runs.
33
+ */
34
+ export declare const resolveFunctions: (fn: any, valueColumns: number) => Functions | FormulaError.Known;
35
+ /**
36
+ * Applies a measure to a group's members.
37
+ *
38
+ * @remarks
39
+ * `y` is every kept value of the column, and only a function that REQUIRES two arguments gets it
40
+ * (`PERCENTOF`, `LAMBDA(x,y,…)`; a20–a22). An array result, a 1×1 included, is `#VALUE!` for that
41
+ * cell (a25, r05, r06); a single-cell reference reads as its value, and an error — returned or
42
+ * thrown — is just the cell's value.
43
+ */
44
+ export declare const aggregate: (measure: Measure, x: IRange, y: () => IRange) => Scalar;
45
+ /**
46
+ * How the first row is read — see {@link resolveHeaders}.
47
+ */
48
+ export interface Headers {
49
+ /** The first row is a header, not data. */
50
+ readonly hasHeader: boolean;
51
+ /** A header row is output (the data's own, or generated). */
52
+ readonly show: boolean;
53
+ }
54
+ /**
55
+ * The `field_headers` argument, resolved; omitted, it is guessed from the values.
56
+ *
57
+ * @remarks
58
+ * 0: data; 1: header, hidden; 2: no header, generate one; 3: header, shown. Anything else is
59
+ * `#VALUE!` (b10, b11, b16).
60
+ *
61
+ * The guess is the one sort uses: a header when the first two rows hold values of different types
62
+ * in some value column (b01 has `"Sales"` over `10`, b08 has `"Product"` over `"Apple"`). Excel's
63
+ * own rule is not fully measured yet.
64
+ */
65
+ export declare const resolveHeaders: (fieldHeaders: number | undefined, values: IRange) => Headers | FormulaError.Known;
66
+ /**
67
+ * Validates a `total_depth` against the number of key fields.
68
+ *
69
+ * @remarks
70
+ * An integer no deeper than the fields (c04, c16, c20, c21); the sign puts totals first.
71
+ */
72
+ export declare const isValidDepth: (depth: number, fieldCount: number) => boolean;
73
+ /**
74
+ * One axis's sort: a direction per key level, or a sort by an aggregate.
75
+ */
76
+ export interface SortSpec {
77
+ /** Per key level, 1 ascending or -1 descending. */
78
+ readonly keyDirections: number[];
79
+ /** Sort by an aggregate column: the measure's index and its direction. */
80
+ readonly byValue: {
81
+ readonly measure: number;
82
+ readonly direction: number;
83
+ } | null;
84
+ }
85
+ /**
86
+ * Parses a `sort_order` argument.
87
+ *
88
+ * @param valueColumns How many aggregate columns follow the keys; an index past the keys picks one.
89
+ *
90
+ * @remarks
91
+ * `±k` sorts key level `k`, or, past the keys, an aggregate column (d02, d05). Several indices must
92
+ * be distinct key levels, no more than there are (d09, d11, r12–r15). Zero, out of range, text, a
93
+ * fraction and a logical are `#VALUE!` (d07, d08, d16, d17, r24).
94
+ */
95
+ export declare const resolveSort: (sortOrder: IRange | undefined, fieldCount: number, valueColumns: number) => SortSpec | FormulaError.Known;
96
+ /**
97
+ * Whether `values` is one blank CELL — refused for the whole call (g16, g19).
98
+ *
99
+ * @remarks
100
+ * The rule `ARRAYTOTEXT` has for a lone blank: a reference to one empty cell is `#VALUE!`, while a
101
+ * blank KEY (g21), two blank cells (g18) or a blank array member are ordinary values.
102
+ */
103
+ export declare const isLoneBlankCell: (values: IRange) => boolean;
104
+ /**
105
+ * Validates a `filter_array` against the record count.
106
+ *
107
+ * @remarks
108
+ * One column as tall as the data, holding logicals and numbers only: an error or text anywhere is
109
+ * `#VALUE!` for the whole call (f06, f08), as is a shape mismatch (f03, f09, f11).
110
+ */
111
+ export declare const isValidFilter: (filter: IRange, recordCount: number) => boolean;
112
+ /**
113
+ * A group at one key level of an axis.
114
+ */
115
+ export interface AxisNode {
116
+ /** The key level, 0 for the outermost field. */
117
+ readonly level: number;
118
+ /** The group within that level's grouping. */
119
+ readonly group: number;
120
+ /** The keys down to this level, as spelled by the group's first record. */
121
+ readonly keys: readonly Scalar[];
122
+ /** The group one level up, `null` at the outermost level. */
123
+ readonly parent: AxisNode | null;
124
+ readonly children: AxisNode[];
125
+ }
126
+ /**
127
+ * One output line of an axis: a group at the innermost level, a subtotal, or the grand total.
128
+ */
129
+ export interface AxisLine {
130
+ readonly kind: 'group' | 'subtotal' | 'total';
131
+ /** `null` for the grand total. */
132
+ readonly node: AxisNode | null;
133
+ }
134
+ /**
135
+ * One axis of groups — `GROUPBY`'s rows, or either side of `PIVOTBY`.
136
+ *
137
+ * @remarks
138
+ * Each key level has its own grouping, over the key columns down to it, so a subtotal's members are
139
+ * one group of that grouping rather than a union of its children's. A level's parent is read
140
+ * through its first record (`getFirstRecord`/`getGroup`).
141
+ */
142
+ export declare class PivotAxis {
143
+ readonly fieldCount: number;
144
+ /** Per key level, the grouping over the key columns down to it. */
145
+ readonly groupings: IFormulaContext.Grouping[];
146
+ /** Per key level, the key columns down to it. */
147
+ readonly prefixes: IRange[];
148
+ readonly roots: AxisNode[];
149
+ constructor(keys: IRange, filter: IRange | undefined);
150
+ /** The number of records kept. */
151
+ getRecordCount(): number;
152
+ /** A node's members of one value column. */
153
+ getMembers(values: IRange, node: AxisNode | null): IRange;
154
+ /**
155
+ * Orders the groups at every level.
156
+ *
157
+ * @param valueOf A node's aggregate, for a sort by value.
158
+ * @param table Field relationship 1: one flat order over the innermost groups (d18).
159
+ *
160
+ * @remarks
161
+ * Keys sort by the comparison operators' order — numbers, text, `FALSE`, `TRUE`, errors — with
162
+ * a blank key last in either direction (e01, e02). A sort by value orders each level by its own
163
+ * aggregate, parents by their subtotal (d05); ties keep key order (e06), and an error aggregate
164
+ * sorts last.
165
+ */
166
+ sort(spec: SortSpec, valueOf: (node: AxisNode) => Scalar, table: boolean): AxisNode[];
167
+ /**
168
+ * The output lines in order, with subtotals and the grand total placed per `depth`.
169
+ *
170
+ * @remarks
171
+ * `|depth|` 1 is the grand total alone; each step deeper adds subtotals for one more level from
172
+ * the top (c03, c13, c14). A negative depth puts every total before what it totals (c06, c15).
173
+ */
174
+ lines(roots: AxisNode[], depth: number): AxisLine[];
175
+ /**
176
+ * The key cells of a line: its keys, `""` past its level, and the total's label.
177
+ *
178
+ * @remarks
179
+ * A blank key shows as `0`, as Excel spills it (a01); padding is `""` (b09, c03). The grand total
180
+ * is `Grand Total` once subtotals show, `Total` otherwise (c02, c03).
181
+ */
182
+ keyCells(line: AxisLine, depth: number): Scalar[];
183
+ }
184
+ /**
185
+ * The generated header of key field `index` (0-based), for `field_headers` 2 (b04).
186
+ */
187
+ export declare const generatedFieldLabel: (index: number) => string;
188
+ /**
189
+ * The generated header of `PIVOTBY` column field `index` (0-based), for `field_headers` 2 (p43).
190
+ */
191
+ export declare const generatedColumnFieldLabel: (index: number) => string;
192
+ /**
193
+ * The generated header of value column `index` (0-based), for `field_headers` 2 (b04).
194
+ */
195
+ export declare const generatedValueLabel: (index: number) => string;
196
+ /**
197
+ * The columns of a range, one slice each — the same object every time it is asked for, which is
198
+ * what lets a grouping reuse its work on a value column.
199
+ */
200
+ export declare const columnsOf: (range: IRange) => IRange[];
201
+ /**
202
+ * A range without its first row — the data under a header.
203
+ */
204
+ export declare const withoutFirstRow: (range: IRange) => IRange;
205
+ //# sourceMappingURL=Pivot.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { FormulaError } from '@sheetxl/primitives';
2
+ /** A compiled Excel pattern: the regex, and how many capture groups it has. */
3
+ export interface CompiledPattern {
4
+ regex: RegExp;
5
+ groups: number;
6
+ }
7
+ /**
8
+ * Compiles one of Excel's patterns, or `#VALUE!` when neither reading of it will compile.
9
+ *
10
+ * The translated form is tried first, under `u`. A pattern that will not compile that way is
11
+ * retried EXACTLY AS WRITTEN and without `u` — that is the pre-translation reading, and it keeps
12
+ * the patterns that only `u`'s stricter escaping would have broken (`\-` outside a class) working.
13
+ */
14
+ export declare const compilePattern: (pattern: string, caseInsensitive: boolean, extraFlags?: string) => CompiledPattern | FormulaError.Known;
15
+ /**
16
+ * Excel's replacement text, as JavaScript's.
17
+ *
18
+ * The two languages nearly agree — `$1`, `$&`, `` $` `` and `$'` mean the same in both — and
19
+ * differ in three places: Excel's `$0` is the whole match (JavaScript spells that `$&`), its
20
+ * `${1}` and `${name}` are references where JavaScript reads them literally, and a reference to a
21
+ * group that does not exist is `#VALUE!` rather than literal text. That last one is why this
22
+ * returns an error instead of a string: `REGEXREPLACE("ab","(a)(b)","$3")` is refused by Excel,
23
+ * and so is a lone `$`.
24
+ */
25
+ export declare const translateReplacement: (replacement: string, groups: number) => string | FormulaError.Known;
26
+ /**
27
+ * Excel's 0-or-1 enum slots (`caseSensitivity`, and `returnMode`'s three values).
28
+ *
29
+ * Truncated first — 1.5 is 1 — and anything outside the list is `#VALUE!`, including a huge value
30
+ * and non-numeric text.
31
+ */
32
+ export declare const readMode: (value: number, max: number) => number | FormulaError.Known;
33
+ //# sourceMappingURL=RegexCompile.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /**
2
+ * Returns a key performance indicator (KPI) property and displays the KPI name in the cell.
2
3
  * @hidden Unimplemented Cube
3
- * @summary Returns a key performance indicator (KPI) property and displays the KPI name in the cell.
4
4
  * @param connection is the name of a connection to an OLAP cube.
5
5
  * @param kpiName is the KPI name.
6
6
  * @param kpiProperty is the KPI property.
@@ -9,24 +9,24 @@
9
9
  export declare function CUBEKPIMEMBER(connection: string, kpiName: string, kpiProperty: number, // option 1-6
10
10
  caption?: string): Promise<string>;
11
11
  /**
12
+ * Returns a member or tuple from the cube.
12
13
  * @hidden Unimplemented Cube
13
- * @summary Returns a member or tuple from the cube.
14
14
  * @param connection is the name of a connection to an OLAP cube.
15
15
  * @param memberExpression is the expression representing the name of a member or tuple in the OLAP cube.
16
16
  * @param caption is the caption to be displayed in the cell.
17
17
  */
18
18
  export declare function CUBEMEMBER(connection: string, memberExpression: string, caption?: string): Promise<string>;
19
19
  /**
20
+ * Returns the value of a member property from the cube.
20
21
  * @hidden Unimplemented Cube
21
- * @summary Returns the value of a member property from the cube.
22
22
  * @param connection is the name of a connection to an OLAP cube.
23
23
  * @param memberExpression is the expression representing the name of a member in the OLAP cube.
24
24
  * @param kpiProperty is the property name.
25
25
  */
26
26
  export declare function CUBEMEMBERPROPERTY(connection: string, memberExpression: string, kpiProperty: number): Promise<string>;
27
27
  /**
28
+ * Returns the nth, or ranked, member in a set.
28
29
  * @hidden Unimplemented Cube
29
- * @summary Returns the nth, or ranked, member in a set.
30
30
  * @param connection is the name of a connection to an OLAP cube.
31
31
  * @param setExpression is the set from which the element is to be retrieved.
32
32
  * @param rank is the rank of the element to be retrieved.
@@ -35,8 +35,8 @@ export declare function CUBEMEMBERPROPERTY(connection: string, memberExpression:
35
35
  export declare function CUBERANKEDMEMBER(connection: string, setExpression: string, rank: number, // 1 - 5
36
36
  caption?: string): Promise<string>;
37
37
  /**
38
+ * Defines a calculated set of members or tuples by sending a set expression to the cube on the server, which creates the set, and then returns that set to Microsoft Excel.
38
39
  * @hidden Unimplemented Cube
39
- * @summary Defines a calculated set of members or tuples by sending a set expression to the cube on the server, which creates the set, and then returns that set to Microsoft Excel.
40
40
  * @param connection is the name of a connection to an OLAP cube.
41
41
  * @param setExpression is the expression for the set.
42
42
  * @param caption is the caption to be displayed in the cell.
@@ -49,14 +49,14 @@ caption?: string): Promise<string>;
49
49
  export declare function CUBESET(connection: string, setExpression: string, caption?: string, sortOrder?: number, // 1 - 6
50
50
  sortBy?: string): Promise<string>;
51
51
  /**
52
+ * Returns the number of items in a set.
52
53
  * @hidden Unimplemented Cube
53
- * @summary Returns the number of items in a set.
54
54
  * @param set is the set whose elements are to be counted.
55
55
  */
56
56
  export declare function CUBESETCOUNT(set: string): Promise<number>;
57
57
  /**
58
+ * Returns an aggregated value from the cube.
58
59
  * @hidden Unimplemented Cube
59
- * @summary Returns an aggregated value from the cube.
60
60
  * @param connection is the name of a connection to an OLAP cube.
61
61
  * @param memberExpression is a slicer that determines the portion of the OLAP cube for which the aggregation value is to be retrieved.
62
62
  */
@@ -1,5 +1,6 @@
1
+ import { AcceptError, Omittable, Scalar, NoLift } from '@sheetxl/primitives';
1
2
  /**
2
- * @summary Returns the accrued interest for a security that pays periodic interest.
3
+ * Returns the accrued interest for a security that pays periodic interest.
3
4
  * @param issue is the security's issue date, expressed as a serial date number.
4
5
  * @param firstInterest is the security's first interest date, expressed as a serial date number.
5
6
  * @param settlement is the security's settlement date, expressed as a serial date number.
@@ -10,10 +11,36 @@
10
11
  * @param calcMethod is a logical value: to accrued interest from issue date = TRUE; to calculate from last coupon payment date = FALSE.
11
12
  *
12
13
  * @remarks
13
- * {@link https://support.microsoft.com/en-us/office/accrint-function-fe45d089-6722-4fb3-9379-e1f911d8dc74|Docs}
14
+ * `par · rate/frequency · Σ(Aᵢ/NLᵢ)` over the quasi-coupon periods anchored at `first_interest`,
15
+ * as Excel 16.0 composes it (fn-battery financial/ACCRINT and adhoc-accrint-clamped, 1,796 rows,
16
+ * 2026-08-28 / 2026-09-09) — see {@link accruedPeriods}.
17
+ * The seven leading slots are Excel-declared `any` (a boolean is #VALUE!, an empty slot #N/A —
18
+ * except `par`, which is 1000 when omitted — a blank cell 0); `calc_method` is a logical read
19
+ * FIRST: any number is accepted (nonzero is TRUE), text — `"TRUE"` included — is #VALUE!. Then
20
+ * the slots are read from the first, each coerced and validated before the next (a negative
21
+ * issue is #NUM! over a text frequency, a frequency of 3 over a text basis): every date in the
22
+ * calendar, the frequency 1/2/4 and the basis 0–4 after truncation; then `issue < settlement`,
23
+ * `rate > 0`, `par > 0`, and a quasi-coupon date the walk needs below serial 1 or past the
24
+ * calendar's end is #NUM!. A product that overflows is 0.
14
25
  */
15
- export declare function ACCRINT(issue: number, // date
16
- firstInterest: number, //date
17
- settlement: number, //date
18
- rate: number, par: number, frequency: number, basis?: number, calcMethod?: boolean): number;
26
+ export declare function ACCRINT(issue: NoLift<Omittable<AcceptError<Scalar>>>, firstInterest: NoLift<Omittable<AcceptError<Scalar>>>, settlement: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, par: NoLift<Omittable<AcceptError<Scalar>>>, frequency: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>, calcMethod?: NoLift<Omittable<AcceptError<Scalar>>>): number;
27
+ /**
28
+ * Returns the accrued interest for a security that pays interest at maturity.
29
+ * @param issue is the security's issue date, expressed as a serial date number.
30
+ * @param settlement is the security's maturity date, expressed as a serial date number.
31
+ * @param rate is the security's annual coupon rate.
32
+ * @param par is the security's par value.
33
+ * @param basis is the type of day count basis to use.
34
+ *
35
+ * @remarks
36
+ * `par · rate · yearfrac(issue, settlement)` with YEARFRAC's year fraction (the signed NASD
37
+ * count at basis 0), measured against Excel 16.0 (fn-battery financial/ACCRINTM, 2026-08-28).
38
+ * There is no quasi-coupon walk here — a security paying at maturity has one period — so the
39
+ * two share their reading and nothing else. The slots read from the first: each date is coerced
40
+ * and checked against the calendar before the next slot is looked at, then the rate, the par and
41
+ * the basis are coerced, and only then the date order (`issue ≤ settlement` once truncated —
42
+ * equal is 0) and the signs of the rate and the par. An OMITTED par is 1000 (a blank cell is 0,
43
+ * and #NUM!). A product that overflows is 0.
44
+ */
45
+ export declare function ACCRINTM(issue: NoLift<Omittable<AcceptError<Scalar>>>, settlement: NoLift<Omittable<AcceptError<Scalar>>>, rate: NoLift<Omittable<AcceptError<Scalar>>>, par: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<AcceptError<Scalar>>>): number;
19
46
  //# sourceMappingURL=ACCRINT.d.ts.map
@@ -1,6 +1,6 @@
1
+ import { Scalar, Omittable, NoLift } from '@sheetxl/primitives';
1
2
  /**
2
- * @summary Returns the depreciation for each accounting period using a
3
- * depreciation coefficient (French degressive / accelerated depreciation).
3
+ * Returns the depreciation for each accounting period using a depreciation coefficient (French degressive / accelerated depreciation).
4
4
  * @param cost is the cost of the asset.
5
5
  * @param datePurchased is the date the asset is purchased.
6
6
  * @param firstPeriod is the date of the end of the first period.
@@ -10,44 +10,26 @@
10
10
  * @param basis is the type of day count basis to use.
11
11
  *
12
12
  * @remarks
13
- * AMORDEGRC is the accelerated counterpart to AMORLINC. The depreciation
14
- * rate is multiplied by a coefficient that depends on the asset's useful life
15
- * (computed as `1 / rate`):
13
+ * Measured against Excel 16.0 (fn-battery financial/AMORDEGRC, 2026-08-28), where it differs from
14
+ * the documentation in most places:
16
15
  *
17
- * life (1/rate) │ coefficient
18
- * ───────────────┼────────────
19
- * < 3 years │ 1.5 (special algorithm — see below)
20
- * 3–4 years │ 1.5
21
- * 5–6 years │ 2.0
22
- * > 6 years │ 2.5
23
- *
24
- * The accelerated rate = rate × coefficient.
25
- *
26
- * Normal algorithm (life >= 3, per Excel spec):
27
- * Period 0: FLOOR(cost × rateAccel × (days / 365)) [basis=1 always uses 365]
28
- * bv carry-forward uses actual yearDays (366 for leap years)
29
- * Period N: FLOOR(max(DDB, SL)) where:
30
- * DDB = bv × rateAccel
31
- * SL = bv / (ceil(1/rate) − period) [no salvage subtraction]
32
- * No clamping to (bv − salvage) — Excel deprecates past salvage.
33
- * Returns 0 when bv ≤ salvage at start of period.
34
- *
35
- * Special algorithm (life < 3):
36
- * Period 0: FLOOR(cost × rateAccel × (days / actualYearDays))
37
- * Period N: CEIL(bv / (ceil(1/rate) − 1)) — same value for all remaining periods
38
- * Returns 0 once all remaining periods are exhausted.
39
- *
40
- * Excel-verified behaviors:
41
- * - basis=2 and basis=4 return #NUM! (unlike AMORLINC which rejects basis=2
42
- * only; AMORDEGRC rejects both)
43
- * - life < 3 does NOT return #NUM! despite documentation — Excel computes
44
- * using coeff=1.5 with the simplified equal-split algorithm above
45
- * - period 0 for basis=1 with life >= 3: return value uses yearDays=365,
46
- * but the bv carried into period 1 uses the actual yearDays (366 for leap).
47
- * This means total depreciation across all periods can exceed cost by 1
48
- * for the life < 3 case — this matches Excel's behavior exactly.
16
+ * - The life is `1/rate`. A life of 2 or less is #NUM!; the coefficient is 1.5 up to a life of 4,
17
+ * 2 up to 6, 2.5 beyond (the documented "1 to 2 years" and "4 to 5 years" bands do not exist).
18
+ * - Period 0 is `cost · rate · coefficient · stub fraction` (the AMORLINC stub, see
19
+ * `getAmorDayCount`), capped at `cost − salvage`, ROUNDED — half away from zero, not
20
+ * floored — and carried into the balance rounded.
21
+ * - Each later period is the declining charge `balance · rate · coefficient`, except the LAST
22
+ * TWO periods of `ceil(life)`, which split the balance in two and then take the rest. There is
23
+ * no other straight-line switch (a 10-year asset stays on the declining charge in period 7
24
+ * although straight line is larger). Every returned charge is rounded, but the balance carries
25
+ * the UNROUNDED charge.
26
+ * - A balance already below salvage at the start of a period returns 0; one equal to salvage is
27
+ * still depreciated (`AMORDEGRC(2400,…,2399,1,0.15,1)` is 900).
28
+ * - A period under 1 is period 1 and above 1 truncates — except that Excel answers other
29
+ * periods' values for some fractions below 1 (0.1 and 1E-300 answer period 5, 0.5 answers 0);
30
+ * those rows are accepted differences.
31
+ * - Every argument is Excel-declared `any`: a boolean is refused, an empty argument is missing, a
32
+ * multi-cell reference does not broadcast. Basis truncates and 2 is refused; 4 is accepted.
49
33
  */
50
- export declare function AMORDEGRC(cost: number, datePurchased: number, // date serial
51
- firstPeriod: number, // date serial
52
- salvage: number, period: number, rate: number, basis?: number): number;
34
+ export declare function AMORDEGRC(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;
53
35
  //# sourceMappingURL=AMORDEGRC.d.ts.map
@@ -0,0 +1,118 @@
1
+ import { Scalar, Omittable, NoLift, ReportType } from '@sheetxl/primitives';
2
+ /**
3
+ * When payments are due in each period.
4
+ *
5
+ * @remarks
6
+ * Declared `ReportType`, as every numeric built-in enum is: Excel reads any nonzero value as 1
7
+ * (`2`, `-1` and `0.5` all mean "beginning", measured), which an enum's gate does not, so the
8
+ * bodies keep the verdict. CUMIPMT and CUMPRINC declare it as `PaymentType | Scalar`: their bodies
9
+ * read the raw argument themselves, and answer #NUM! for anything but 0 or 1.
10
+ */
11
+ declare enum PaymentType {
12
+ /**
13
+ * Payments are due at the end of each period.
14
+ * @name At the end of the period
15
+ */
16
+ End = 0,
17
+ /**
18
+ * Payments are due at the beginning of each period.
19
+ * @name At the beginning of the period
20
+ */
21
+ Beginning = 1
22
+ }
23
+ /**
24
+ * Returns the future value of an investment based on periodic, constant payments and a constant interest rate.
25
+ * @param rate is the interest rate.
26
+ * @param nper is the total number of payment periods.
27
+ * @param pmt is the payment made each period; it cannot change over the life of the investment.
28
+ * @param pv is the present value of the investment.
29
+ * @param type Indicates when payments are due: at the end of the period = 0, at the beginning of the period = 1.
30
+ */
31
+ export declare function FV(rate: number, nper: number, pmt: number, pv?: number, type?: ReportType<PaymentType>): number;
32
+ /**
33
+ * Returns the present value of an investment: the total amount that a series of future payments is worth now.
34
+ * @param rate is the interest rate.
35
+ * @param nper is the total number of payment periods in an investment.
36
+ * @param pmt is the payment made each period and cannot change over the life of the investment.
37
+ * @param fv is the future value, or a cash balance you want to attain after the last payment is made.
38
+ * @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
39
+ */
40
+ export declare function PV(rate: number, nper: number, pmt: number, fv?: number, type?: ReportType<PaymentType>): number;
41
+ /**
42
+ * Calculates the payment for a loan based on constant payments and a constant interest rate.
43
+ * @param rate is the interest rate.
44
+ * @param nper is the total number of payment periods.
45
+ * @param pv is the present value of the investment.
46
+ * @param fv is the future value, or a cash balance you want to attain after the last payment is made.
47
+ * @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
48
+ */
49
+ export declare function PMT(rate: number, nper: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
50
+ /**
51
+ * Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.
52
+ * @param rate is the interest rate per period. For example, use 6%/4 for quarterly payments at 6% APR.
53
+ * @param pmt is the payment made each period; it cannot change over the life of the investment.
54
+ * @param pv is the present value, or the lump-sum amount that a series of future payments is worth now.
55
+ * @param fv is the future value, or a cash balance you want to attain after the last payment is made.
56
+ * @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
57
+ */
58
+ export declare function NPER(rate: number, pmt: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
59
+ /**
60
+ * Returns the interest rate per period of a loan or an investment. For example, use 6%/4 for quarterly payments at 6% APR.
61
+ * @param nper is the total number of payment periods.
62
+ * @param pmt is the payment made each period and cannot change over the life of the loan or investment.
63
+ * @param pv is the present value: the total amount that a series of future payments is worth now.
64
+ * @param fv is the future value, or a cash balance you want to attain after the last payment is made.
65
+ * @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
66
+ * @param guess is your guess for what the rate will be.
67
+ */
68
+ export declare function RATE(nper: number, pmt: number, pv: number, fv?: number, type?: ReportType<PaymentType>, guess?: number): number;
69
+ /**
70
+ * Returns the interest payment for a given period for an investment, based on periodic, constant payments and a constant interest rate.
71
+ * @param rate is the interest rate.
72
+ * @param per is the period for which you want to find the interest and must be in the range 1 to Nper.
73
+ * @param nper is the total number of payment periods.
74
+ * @param pv is the present value of the investment.
75
+ * @param fv is the future value, or a cash balance you want to attain after the last payment is made.
76
+ * @param type is a logical value representing the timing of payment: at the end of the period = 0, at the beginning of the period = 1.
77
+ */
78
+ export declare function IPMT(rate: number, per: number, nper: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
79
+ /**
80
+ * Returns the payment on the principal for a given investment based on periodic, constant payments and a constant payments and a constant interest rate.
81
+ * @param rate is the interest rate per period.
82
+ * @param per is the period for which you want to find the principal payment and must be in the range 1 to Nper.
83
+ * @param nper is the total number of payment periods in the investment.
84
+ * @param pv is the present value of the investment.
85
+ * @param fv is the future value, or a cash balance you want to attain after the last payment is made.
86
+ * @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
87
+ */
88
+ export declare function PPMT(rate: number, per: number, nper: number, pv: number, fv?: number, type?: ReportType<PaymentType>): number;
89
+ /**
90
+ * Returns the cumulative interest paid between two periods.
91
+ * @param rate is the interest rate.
92
+ * @param nper is the total number of payment periods.
93
+ * @param pv is the present value of the investment.
94
+ * @param startPeriod is the first period in the calculation.
95
+ * @param endPeriod is the last period in the calculation.
96
+ * @param type is the timing of the payment.
97
+ */
98
+ export declare function CUMIPMT(rate: NoLift<Omittable<Scalar>>, nper: NoLift<Omittable<Scalar>>, pv: NoLift<Omittable<Scalar>>, startPeriod: NoLift<Omittable<Scalar>>, endPeriod: NoLift<Omittable<Scalar>>, type: NoLift<Omittable<PaymentType | Scalar>>): number;
99
+ /**
100
+ * Returns the cumulative principal paid on a loan between two periods.
101
+ * @param rate is the interest rate.
102
+ * @param nper is the total number of payment periods.
103
+ * @param pv is the present value of the investment.
104
+ * @param startPeriod is the first period in the calculation.
105
+ * @param endPeriod is the last period in the calculation.
106
+ * @param type is the timing of the payment.
107
+ */
108
+ export declare function CUMPRINC(rate: NoLift<Omittable<Scalar>>, nper: NoLift<Omittable<Scalar>>, pv: NoLift<Omittable<Scalar>>, startPeriod: NoLift<Omittable<Scalar>>, endPeriod: NoLift<Omittable<Scalar>>, type: NoLift<Omittable<PaymentType | Scalar>>): number;
109
+ /**
110
+ * Returns the interest paid during a specific period of an investment.
111
+ * @param rate is the interest rate.
112
+ * @param per period for which you want to find the interest.
113
+ * @param nper number of payment periods in an investment.
114
+ * @param pv lump sum amount that a series of future payments is right now.
115
+ */
116
+ export declare function ISPMT(rate: number, per: number, nper: number, pv: number): number;
117
+ export {};
118
+ //# sourceMappingURL=Annuity.d.ts.map
@@ -0,0 +1,84 @@
1
+ import { Scalar, Omittable, AcceptError, IRange, Flatten, NoLift } from '@sheetxl/primitives';
2
+ /**
3
+ * Returns the net present value of an investment based on a discount rate and a series of future payments (negative values) and income (positive values).
4
+ * @param rate is the rate of discount over the length of one period.
5
+ * @param value are 1 to 254 payments and income, equally spaced in time and occurring at the end of each period.
6
+ */
7
+ export declare function NPV(rate: number, value: IRange<number>[]): number;
8
+ /**
9
+ * Returns the internal rate of return for a series of cash flows.
10
+ * @param values is an array or a reference to cells that contain numbers for which you want to calculate the internal rate of return.
11
+ * @param guess is a number that you guess is close to the result of IRR.
12
+ *
13
+ * @remarks
14
+ * Measured against Excel 16.0 (fn-battery financial/IRR plus `adhoc-irr-iterates` and
15
+ * `adhoc-irr-guess`, 2026-08-29). The member rule is NPV's — a text, boolean, blank or
16
+ * empty-string member is SKIPPED and the periods close up behind it, so `{-100,TRUE,110}` is the
17
+ * two-flow 10% — while an error member is `#VALUE!` whatever its own identity was. An error handed
18
+ * as the whole argument is not a member and keeps its identity (`IRR(NA())` is `#N/A`). `guess` is
19
+ * declared `number` (a boolean coerces, a text is `#VALUE!`), an ABSENT argument is 0.1 where an
20
+ * EMPTY slot and a blank cell are 0, and the domain is the one RATE has at both ends:
21
+ * `guess <= -1` is `#VALUE!`, and so is a guess so large that `1 + guess` is `guess` again
22
+ * (the turn is at 2^53 — `IRR(…,9.007E15)` answers and `IRR(…,9.008E15)` does not).
23
+ */
24
+ export declare function IRR(values: Omittable<Flatten<AcceptError<Scalar>>>, guess?: number): number;
25
+ /**
26
+ * Returns the modified internal rate of return for a series of periodic cash flows.
27
+ * @param values An array of cash flows; must contain at least one positive and one negative value.
28
+ * @param financeRate The interest rate paid on negative cash flows (cost of capital).
29
+ * @param reinvestRate The interest rate received on positive cash flows (reinvestment rate).
30
+ *
31
+ * @remarks
32
+ * Measured against Excel 16.0 (fn-battery financial/MIRR, 2026-08-29). The member rule is IRR's —
33
+ * a text, boolean, blank or empty-string member is SKIPPED and the periods close up, so it also
34
+ * shortens the `n` the exponent counts — but an error member keeps its own identity here where
35
+ * IRR flattens every one to `#VALUE!`. The two rates are declared `number` (a boolean coerces, an
36
+ * empty slot and a blank cell are 0) and are read before the members, so a text rate beats an
37
+ * `#N/A` in the schedule.
38
+ *
39
+ * The form is the documented one, and each side DIVIDES by its own compounding — which is where
40
+ * `#DIV/0!` comes from at a rate of −1 (a flow at period 0 divides by `(1+r)^0` and survives one:
41
+ * `MIRR({-100,110},-1,0)` is 10% while `MIRR({-100,110},0,-1)` is not). Fewer than two flows, or
42
+ * no outflow at all, divides by zero as well.
43
+ */
44
+ export declare function MIRR(values: Omittable<Flatten<AcceptError<Scalar>>>, financeRate: number, reinvestRate: number): number;
45
+ /**
46
+ * Returns the net present value for a schedule of cash flows.
47
+ * @param rate is the discount rate to apply to the cash flows.
48
+ * @param values is a series of cash flows that correspond to a schedule of payments in dates.
49
+ * @param dates is a schedule of payment dates that corresponds to the cash flow payments.
50
+ *
51
+ * @remarks
52
+ * Measured against Excel 16.0 (fn-battery financial/XNPV, 2026-08-29). Each flow is discounted
53
+ * over ACTUAL days from the FIRST date on a 365-day year — `(trunc(dᵢ) − trunc(d₀))/365`, each
54
+ * serial truncated on its own, so a fractional date changes nothing. The dates need not be
55
+ * sorted; they need only fall at or after `d₀`, and a date before it is #NUM!. The rate is
56
+ * strictly positive (0 and below are #NUM!, 1E-300 is an answer), and a discount factor or a
57
+ * sum that overflows is #NUM!. The operands read as {@link readDatedFlows} describes.
58
+ */
59
+ export declare function XNPV(rate: NoLift<Omittable<Scalar>>, values: Omittable<IRange>, dates: Omittable<IRange>): number;
60
+ /**
61
+ * Returns the internal rate of return for a schedule of cash flows.
62
+ * @param values is a series of cash flows that correspond to a schedule of payments in dates.
63
+ * @param dates is a schedule of payment dates that corresponds to the cash flow payments.
64
+ * @param guess is a number that you guess is close to the result of XIRR.
65
+ *
66
+ * @remarks
67
+ * Measured against Excel 16.0 (fn-battery financial/XIRR, 2026-08-29). XIRR is XNPV's equation
68
+ * solved for the rate — the same `(trunc(dᵢ) − trunc(d₀))/365` day count — but neither its
69
+ * operands nor its answer are XNPV's. The members are COERCED rather than refused (numeric text
70
+ * and date text parse; a boolean or a true text is `#VALUE!`), a pair whose VALUE is blank is
71
+ * DROPPED, serial 0 is legal, and the dates need not be ordered at all: a flow before `d₀` is
72
+ * discounted by a negative exponent. Fewer than two surviving pairs is `#N/A`; two of the same
73
+ * sign is `#NUM!`. `guess` is ATP `any` — a boolean is `#VALUE!`, an EMPTY slot is the 0.1
74
+ * default where a blank cell is 0, and a reference does not lift.
75
+ *
76
+ * Excel's own answer is only accurate to about eight digits and moves with the guess in the
77
+ * ninth, so the fixture's numeric rows carry a `precision` (CALC-ISSUES 26): its
78
+ * iteration is unidentified, as YIELD's and ODDFYIELD's are. What IS reproduced is the search's
79
+ * one directional rule — from a NEGATIVE guess Excel never reaches a positive root
80
+ * (`XIRR({-100,110},…,-0.5)` is `#NUM!` while the same call at guess 0 answers 10%), though a
81
+ * non-negative guess reaches a negative root freely.
82
+ */
83
+ export declare function XIRR(values: Omittable<IRange>, dates: Omittable<IRange>, guess?: NoLift<Omittable<Scalar>>): number;
84
+ //# sourceMappingURL=Cashflow.d.ts.map