@sheetxl/formulas-extended 0.8.0-beta.1 → 0.8.0-beta.10

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 (136) hide show
  1. package/browser/esm/{BuGemmv84T8m0wqw.mjs → B8U2Eza2ZD4YA-kx.mjs} +1 -1
  2. package/browser/esm/{DpoZ7h1ScIJvbOY9.mjs → BFtgupqxZCxn0dyD.mjs} +5 -5
  3. package/{node/esm/vu0NRDeeTbEHPMYS.mjs → browser/esm/Bg1eKDrYnq3wm8Vk.mjs} +2 -2
  4. package/browser/esm/Bg54DWqi-iRcswhc.mjs +119 -0
  5. package/browser/esm/BiXqZc5QZjxe9VkT.mjs +32 -0
  6. package/browser/esm/BskZz_6FiOeOABjK.mjs +20 -0
  7. package/browser/esm/C2QrdSuGHG9jhlMh.mjs +23 -0
  8. package/{node/esm/BRwwvGaJ6HvkxjFC.mjs → browser/esm/C9G09aQXW2LLuPt3.mjs} +1 -1
  9. package/browser/esm/CFee1d5IBiv4fv1i.mjs +37 -0
  10. package/browser/esm/{BFnDPCjxJcoIItFa.mjs → CHIJMJGn8-ecsv3s.mjs} +3 -3
  11. package/browser/esm/CJjzoao3hDloxUGc.mjs +19 -0
  12. package/browser/esm/CcDbY4A8EXqKtmVV.mjs +47 -0
  13. package/{node/esm/DodhOXkSzelSxHmB.mjs → browser/esm/Cl3Yo2J4W4DMr8oz.mjs} +27 -29
  14. package/browser/esm/D02eJGMi5PwKHsoL.mjs +58 -0
  15. package/{node/esm/Bma3CN4_Nec6_4n7.mjs → browser/esm/DEQlCPiGb8bsBizr.mjs} +6 -6
  16. package/browser/esm/{B1VmvhXuEn7zaTB9.mjs → DSBsgMaUW3RQ6ceC.mjs} +1 -1
  17. package/{node/esm/COqdI1LYTHd9oLA6.mjs → browser/esm/Db0ejvxhdCFJuDKI.mjs} +1 -1
  18. package/{node/esm/srpVt74r2zbvm1N0.mjs → browser/esm/Dcl4zSjM1tlh53wy.mjs} +5 -5
  19. package/browser/esm/Djzfm7ZsIsQvtPGt.mjs +32 -0
  20. package/{node/esm/CnVJ8GAsshRjRGA-.mjs → browser/esm/WS_eaJSI0r2L5MVv.mjs} +2 -2
  21. package/browser/esm/g9IHvvfn4bYTwHgl.mjs +33 -0
  22. package/browser/esm/index.mjs +3818 -1682
  23. package/browser/esm/{DY3kG36QGyDbrANO.mjs → yS93vAhNdRw2bt-z.mjs} +1 -1
  24. package/node/esm/{BuGemmv84T8m0wqw.mjs → B8U2Eza2ZD4YA-kx.mjs} +1 -1
  25. package/node/esm/{DpoZ7h1ScIJvbOY9.mjs → BFtgupqxZCxn0dyD.mjs} +5 -5
  26. package/node/esm/BHHFJIl22DBeM9aP.mjs +19 -0
  27. package/{browser/esm/vu0NRDeeTbEHPMYS.mjs → node/esm/Bg1eKDrYnq3wm8Vk.mjs} +2 -2
  28. package/node/esm/Bg54DWqi-iRcswhc.mjs +119 -0
  29. package/node/esm/BiXqZc5QZjxe9VkT.mjs +32 -0
  30. package/node/esm/BskZz_6FiOeOABjK.mjs +20 -0
  31. package/node/esm/C2QrdSuGHG9jhlMh.mjs +23 -0
  32. package/{browser/esm/BRwwvGaJ6HvkxjFC.mjs → node/esm/C9G09aQXW2LLuPt3.mjs} +1 -1
  33. package/node/esm/CFee1d5IBiv4fv1i.mjs +37 -0
  34. package/node/esm/{BQyZVLTMNFLbjVap.mjs → C_IrfNxfWXKc8kjo.mjs} +3 -3
  35. package/node/esm/{LAkTk93odAfpvx50.mjs → Cc4Bkwtihl8DmEub.mjs} +1 -1
  36. package/node/esm/CcDbY4A8EXqKtmVV.mjs +47 -0
  37. package/{browser/esm/DodhOXkSzelSxHmB.mjs → node/esm/Cl3Yo2J4W4DMr8oz.mjs} +27 -29
  38. package/node/esm/D02eJGMi5PwKHsoL.mjs +58 -0
  39. package/{browser/esm/Bma3CN4_Nec6_4n7.mjs → node/esm/DEQlCPiGb8bsBizr.mjs} +6 -6
  40. package/node/esm/{B1VmvhXuEn7zaTB9.mjs → DSBsgMaUW3RQ6ceC.mjs} +1 -1
  41. package/{browser/esm/COqdI1LYTHd9oLA6.mjs → node/esm/Db0ejvxhdCFJuDKI.mjs} +1 -1
  42. package/{browser/esm/srpVt74r2zbvm1N0.mjs → node/esm/Dcl4zSjM1tlh53wy.mjs} +5 -5
  43. package/node/esm/Djzfm7ZsIsQvtPGt.mjs +32 -0
  44. package/{browser/esm/CnVJ8GAsshRjRGA-.mjs → node/esm/WS_eaJSI0r2L5MVv.mjs} +2 -2
  45. package/node/esm/g9IHvvfn4bYTwHgl.mjs +33 -0
  46. package/node/esm/index.mjs +4147 -1993
  47. package/package.json +5 -6
  48. package/types/src/.generated/decl/financial/Annuity.decl.d.ts +5 -0
  49. package/types/src/.generated/decl/financial/{Financial.decl.d.ts → Cashflow.decl.d.ts} +1 -1
  50. package/types/src/.generated/decl/financial/Convert.decl.d.ts +4 -0
  51. package/types/src/.generated/decl/financial/Coupon.decl.d.ts +4 -0
  52. package/types/src/.generated/decl/financial/{Financial2.decl.d.ts → Depreciation.decl.d.ts} +1 -1
  53. package/types/src/.generated/decl/financial/Growth.decl.d.ts +4 -0
  54. package/types/src/.generated/decl/financial/{ODD.decl.d.ts → Odd.decl.d.ts} +1 -1
  55. package/types/src/.generated/decl/financial/{Financial3.decl.d.ts → STOCKHISTORY.decl.d.ts} +1 -1
  56. package/types/src/.generated/decl/financial/Security.decl.d.ts +4 -0
  57. package/types/src/.generated/decl/financial/{Financial4.decl.d.ts → SecurityMaturity.decl.d.ts} +1 -1
  58. package/types/src/.generated/decl/{statistical/TTEST.decl.d.ts → financial/TBill.decl.d.ts} +1 -1
  59. package/types/src/.generated/decl/lookupReference/GroupBy.decl.d.ts +4 -0
  60. package/types/src/.generated/decl/lookupReference/PivotBy.decl.d.ts +4 -0
  61. package/types/src/.generated/decl/statistical/{ETS.decl.d.ts → Ets.decl.d.ts} +1 -1
  62. package/types/src/.generated/decl/statistical/TTest.decl.d.ts +4 -0
  63. package/types/src/.generated/desc/financial/Annuity.desc.d.ts +5 -0
  64. package/types/src/.generated/desc/financial/{Financial.desc.d.ts → Cashflow.desc.d.ts} +1 -1
  65. package/types/src/.generated/desc/financial/Convert.desc.d.ts +4 -0
  66. package/types/src/.generated/desc/financial/Coupon.desc.d.ts +4 -0
  67. package/types/src/.generated/desc/financial/{Financial2.desc.d.ts → Depreciation.desc.d.ts} +1 -1
  68. package/types/src/.generated/desc/financial/Growth.desc.d.ts +4 -0
  69. package/types/src/.generated/desc/financial/{ODD.desc.d.ts → Odd.desc.d.ts} +1 -1
  70. package/types/src/.generated/desc/financial/{Financial3.desc.d.ts → STOCKHISTORY.desc.d.ts} +1 -1
  71. package/types/src/.generated/desc/financial/Security.desc.d.ts +4 -0
  72. package/types/src/.generated/desc/financial/{Financial4.desc.d.ts → SecurityMaturity.desc.d.ts} +1 -1
  73. package/types/src/.generated/desc/{statistical/TTEST.desc.d.ts → financial/TBill.desc.d.ts} +1 -1
  74. package/types/src/.generated/desc/lookupReference/GroupBy.desc.d.ts +4 -0
  75. package/types/src/.generated/desc/lookupReference/PivotBy.desc.d.ts +4 -0
  76. package/types/src/.generated/desc/statistical/{ETS.desc.d.ts → Ets.desc.d.ts} +1 -1
  77. package/types/src/.generated/desc/statistical/TTest.desc.d.ts +4 -0
  78. package/types/src/_utils/AnyArgs.d.ts +17 -3
  79. package/types/src/_utils/FinanaceSolver.d.ts +39 -2
  80. package/types/src/_utils/FinanceAmor.d.ts +23 -0
  81. package/types/src/_utils/FinanceCashflow.d.ts +42 -0
  82. package/types/src/_utils/FinanceCoupon.d.ts +92 -82
  83. package/types/src/_utils/FinanceDate.d.ts +24 -0
  84. package/types/src/_utils/FinanceDayCount.d.ts +46 -0
  85. package/types/src/_utils/FinanceOdd.d.ts +93 -0
  86. package/types/src/_utils/FinanceSecurity.d.ts +84 -0
  87. package/types/src/_utils/FinanceUtils.d.ts +37 -1
  88. package/types/src/_utils/LeastSquares.d.ts +20 -22
  89. package/types/src/_utils/Pivot.d.ts +205 -0
  90. package/types/src/_utils/RegexCompile.d.ts +33 -0
  91. package/types/src/cube/Cube.d.ts +7 -7
  92. package/types/src/financial/ACCRINT.d.ts +33 -6
  93. package/types/src/financial/AMORDEGRC.d.ts +22 -40
  94. package/types/src/financial/Annuity.d.ts +118 -0
  95. package/types/src/financial/Cashflow.d.ts +84 -0
  96. package/types/src/financial/Convert.d.ts +26 -0
  97. package/types/src/financial/Coupon.d.ts +72 -0
  98. package/types/src/financial/Date.d.ts +34 -5
  99. package/types/src/financial/Depreciation.d.ts +58 -0
  100. package/types/src/financial/Growth.d.ts +22 -0
  101. package/types/src/financial/Odd.d.ts +82 -0
  102. package/types/src/financial/STOCKHISTORY.d.ts +17 -0
  103. package/types/src/financial/Security.d.ts +68 -0
  104. package/types/src/financial/SecurityMaturity.d.ts +107 -0
  105. package/types/src/financial/TBill.d.ts +40 -0
  106. package/types/src/financial/VDB.d.ts +15 -13
  107. package/types/src/lookupReference/GroupBy.d.ts +14 -0
  108. package/types/src/lookupReference/PivotBy.d.ts +17 -0
  109. package/types/src/statistical/{ETS.d.ts → Ets.d.ts} +14 -14
  110. package/types/src/statistical/Regression.d.ts +13 -18
  111. package/types/src/statistical/{TTEST.d.ts → TTest.d.ts} +5 -5
  112. package/types/src/text/RegEx.d.ts +34 -11
  113. package/browser/cjs/B4JJfKSI4ppwU855.cjs +0 -1
  114. package/browser/cjs/BWDfauDHqB6U_2ka.cjs +0 -1
  115. package/browser/cjs/BwLx9ix5Sq7suAYP.cjs +0 -1
  116. package/browser/cjs/C2uDl8VIJqh58YF_.cjs +0 -1
  117. package/browser/cjs/CW-b31_-r-_raT8Y.cjs +0 -1
  118. package/browser/cjs/Clu7XiAsCB48GDXN.cjs +0 -1
  119. package/browser/cjs/CnZfa45XxA-9Jhmp.cjs +0 -1
  120. package/browser/cjs/DsFZgtSQpC75d1M0.cjs +0 -1
  121. package/browser/cjs/JfM6P_qoQQTWakZf.cjs +0 -1
  122. package/browser/cjs/bM25C5avKgBAJVfk.cjs +0 -1
  123. package/browser/cjs/fqTQ_p3ehzUvc1tF.cjs +0 -1
  124. package/browser/cjs/h3dw1jAp2J5Pu4p3.cjs +0 -1
  125. package/browser/cjs/index.cjs +0 -1
  126. package/browser/cjs/jev6VGWTdgEgm4Yk.cjs +0 -1
  127. package/browser/cjs/lEQC21-Sk4lwHy2r.cjs +0 -1
  128. package/browser/esm/CwoMEzOtRihuYUTr.mjs +0 -20
  129. package/browser/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
  130. package/node/esm/CwoMEzOtRihuYUTr.mjs +0 -20
  131. package/node/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
  132. package/types/src/financial/Financial.d.ts +0 -288
  133. package/types/src/financial/Financial2.d.ts +0 -99
  134. package/types/src/financial/Financial3.d.ts +0 -95
  135. package/types/src/financial/Financial4.d.ts +0 -82
  136. package/types/src/financial/ODD.d.ts +0 -106
@@ -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
@@ -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
- * @summary Returns the year fraction representing the number of whole days between start_date and end_date.
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, endDate: Scalar, basis?: Scalar): number;
41
+ export declare function YEARFRAC(startDate: NoLift<Omittable<AcceptError<Scalar>>>, endDate: NoLift<Omittable<AcceptError<Scalar>>>, basis?: NoLift<Omittable<Scalar>>): number;
20
42
  /**
21
- * @summary Returns the number of days between two dates based on a 360-day year (twelve 30-day months).
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