@gridsheet/functions 3.0.0-rc.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 (439) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +75 -0
  3. package/dist/functions/src/index.d.ts +7 -0
  4. package/dist/functions/src/index.d.ts.map +1 -0
  5. package/dist/functions/src/information/index.d.ts +4 -0
  6. package/dist/functions/src/information/index.d.ts.map +1 -0
  7. package/dist/functions/src/information/isblank.d.ts +9 -0
  8. package/dist/functions/src/information/isblank.d.ts.map +1 -0
  9. package/dist/functions/src/information/isblank.spec.d.ts +2 -0
  10. package/dist/functions/src/information/isblank.spec.d.ts.map +1 -0
  11. package/dist/functions/src/information/isdate.d.ts +9 -0
  12. package/dist/functions/src/information/isdate.d.ts.map +1 -0
  13. package/dist/functions/src/information/isdate.spec.d.ts +2 -0
  14. package/dist/functions/src/information/isdate.spec.d.ts.map +1 -0
  15. package/dist/functions/src/information/isemail.d.ts +9 -0
  16. package/dist/functions/src/information/isemail.d.ts.map +1 -0
  17. package/dist/functions/src/information/isemail.spec.d.ts +2 -0
  18. package/dist/functions/src/information/isemail.spec.d.ts.map +1 -0
  19. package/dist/functions/src/information/iserr.d.ts +9 -0
  20. package/dist/functions/src/information/iserr.d.ts.map +1 -0
  21. package/dist/functions/src/information/iserr.spec.d.ts +2 -0
  22. package/dist/functions/src/information/iserr.spec.d.ts.map +1 -0
  23. package/dist/functions/src/information/iserror.d.ts +9 -0
  24. package/dist/functions/src/information/iserror.d.ts.map +1 -0
  25. package/dist/functions/src/information/iserror.spec.d.ts +2 -0
  26. package/dist/functions/src/information/iserror.spec.d.ts.map +1 -0
  27. package/dist/functions/src/information/isformula.d.ts +9 -0
  28. package/dist/functions/src/information/isformula.d.ts.map +1 -0
  29. package/dist/functions/src/information/isformula.spec.d.ts +2 -0
  30. package/dist/functions/src/information/isformula.spec.d.ts.map +1 -0
  31. package/dist/functions/src/information/islogical.d.ts +9 -0
  32. package/dist/functions/src/information/islogical.d.ts.map +1 -0
  33. package/dist/functions/src/information/islogical.spec.d.ts +2 -0
  34. package/dist/functions/src/information/islogical.spec.d.ts.map +1 -0
  35. package/dist/functions/src/information/isna.d.ts +9 -0
  36. package/dist/functions/src/information/isna.d.ts.map +1 -0
  37. package/dist/functions/src/information/isna.spec.d.ts +2 -0
  38. package/dist/functions/src/information/isna.spec.d.ts.map +1 -0
  39. package/dist/functions/src/information/isnontext.d.ts +9 -0
  40. package/dist/functions/src/information/isnontext.d.ts.map +1 -0
  41. package/dist/functions/src/information/isnontext.spec.d.ts +2 -0
  42. package/dist/functions/src/information/isnontext.spec.d.ts.map +1 -0
  43. package/dist/functions/src/information/isref.d.ts +9 -0
  44. package/dist/functions/src/information/isref.d.ts.map +1 -0
  45. package/dist/functions/src/information/isref.spec.d.ts +2 -0
  46. package/dist/functions/src/information/isref.spec.d.ts.map +1 -0
  47. package/dist/functions/src/information/istext.d.ts +9 -0
  48. package/dist/functions/src/information/istext.d.ts.map +1 -0
  49. package/dist/functions/src/information/istext.spec.d.ts +2 -0
  50. package/dist/functions/src/information/istext.spec.d.ts.map +1 -0
  51. package/dist/functions/src/information/n.d.ts +9 -0
  52. package/dist/functions/src/information/n.d.ts.map +1 -0
  53. package/dist/functions/src/information/n.spec.d.ts +2 -0
  54. package/dist/functions/src/information/n.spec.d.ts.map +1 -0
  55. package/dist/functions/src/information/na.d.ts +9 -0
  56. package/dist/functions/src/information/na.d.ts.map +1 -0
  57. package/dist/functions/src/information/na.spec.d.ts +2 -0
  58. package/dist/functions/src/information/na.spec.d.ts.map +1 -0
  59. package/dist/functions/src/information/sheets.d.ts +9 -0
  60. package/dist/functions/src/information/sheets.d.ts.map +1 -0
  61. package/dist/functions/src/information/sheets.spec.d.ts +2 -0
  62. package/dist/functions/src/information/sheets.spec.d.ts.map +1 -0
  63. package/dist/functions/src/logical/ifna.d.ts +10 -0
  64. package/dist/functions/src/logical/ifna.d.ts.map +1 -0
  65. package/dist/functions/src/logical/ifs.d.ts +10 -0
  66. package/dist/functions/src/logical/ifs.d.ts.map +1 -0
  67. package/dist/functions/src/logical/index.d.ts +4 -0
  68. package/dist/functions/src/logical/index.d.ts.map +1 -0
  69. package/dist/functions/src/logical/xor.d.ts +9 -0
  70. package/dist/functions/src/logical/xor.d.ts.map +1 -0
  71. package/dist/functions/src/lookup/column.d.ts +12 -0
  72. package/dist/functions/src/lookup/column.d.ts.map +1 -0
  73. package/dist/functions/src/lookup/column.spec.d.ts +2 -0
  74. package/dist/functions/src/lookup/column.spec.d.ts.map +1 -0
  75. package/dist/functions/src/lookup/columns.d.ts +9 -0
  76. package/dist/functions/src/lookup/columns.d.ts.map +1 -0
  77. package/dist/functions/src/lookup/columns.spec.d.ts +2 -0
  78. package/dist/functions/src/lookup/columns.spec.d.ts.map +1 -0
  79. package/dist/functions/src/lookup/hlookup.d.ts +9 -0
  80. package/dist/functions/src/lookup/hlookup.d.ts.map +1 -0
  81. package/dist/functions/src/lookup/hlookup.spec.d.ts +2 -0
  82. package/dist/functions/src/lookup/hlookup.spec.d.ts.map +1 -0
  83. package/dist/functions/src/lookup/index.d.ts +4 -0
  84. package/dist/functions/src/lookup/index.d.ts.map +1 -0
  85. package/dist/functions/src/lookup/indexFn.d.ts +10 -0
  86. package/dist/functions/src/lookup/indexFn.d.ts.map +1 -0
  87. package/dist/functions/src/lookup/indexFn.spec.d.ts +2 -0
  88. package/dist/functions/src/lookup/indexFn.spec.d.ts.map +1 -0
  89. package/dist/functions/src/lookup/match.d.ts +10 -0
  90. package/dist/functions/src/lookup/match.d.ts.map +1 -0
  91. package/dist/functions/src/lookup/match.spec.d.ts +2 -0
  92. package/dist/functions/src/lookup/match.spec.d.ts.map +1 -0
  93. package/dist/functions/src/lookup/row.d.ts +12 -0
  94. package/dist/functions/src/lookup/row.d.ts.map +1 -0
  95. package/dist/functions/src/lookup/row.spec.d.ts +2 -0
  96. package/dist/functions/src/lookup/row.spec.d.ts.map +1 -0
  97. package/dist/functions/src/lookup/rows.d.ts +9 -0
  98. package/dist/functions/src/lookup/rows.d.ts.map +1 -0
  99. package/dist/functions/src/lookup/rows.spec.d.ts +2 -0
  100. package/dist/functions/src/lookup/rows.spec.d.ts.map +1 -0
  101. package/dist/functions/src/lookup/sheet.d.ts +9 -0
  102. package/dist/functions/src/lookup/sheet.d.ts.map +1 -0
  103. package/dist/functions/src/lookup/sheet.spec.d.ts +2 -0
  104. package/dist/functions/src/lookup/sheet.spec.d.ts.map +1 -0
  105. package/dist/functions/src/lookup/vlookup.d.ts +9 -0
  106. package/dist/functions/src/lookup/vlookup.d.ts.map +1 -0
  107. package/dist/functions/src/lookup/vlookup.spec.d.ts +2 -0
  108. package/dist/functions/src/lookup/vlookup.spec.d.ts.map +1 -0
  109. package/dist/functions/src/math/__matrix_base.d.ts +15 -0
  110. package/dist/functions/src/math/__matrix_base.d.ts.map +1 -0
  111. package/dist/functions/src/math/acos.d.ts +9 -0
  112. package/dist/functions/src/math/acos.d.ts.map +1 -0
  113. package/dist/functions/src/math/acos.spec.d.ts +2 -0
  114. package/dist/functions/src/math/acos.spec.d.ts.map +1 -0
  115. package/dist/functions/src/math/asin.d.ts +9 -0
  116. package/dist/functions/src/math/asin.d.ts.map +1 -0
  117. package/dist/functions/src/math/asin.spec.d.ts +2 -0
  118. package/dist/functions/src/math/asin.spec.d.ts.map +1 -0
  119. package/dist/functions/src/math/atan.d.ts +9 -0
  120. package/dist/functions/src/math/atan.d.ts.map +1 -0
  121. package/dist/functions/src/math/atan.spec.d.ts +2 -0
  122. package/dist/functions/src/math/atan.spec.d.ts.map +1 -0
  123. package/dist/functions/src/math/atan2.d.ts +9 -0
  124. package/dist/functions/src/math/atan2.d.ts.map +1 -0
  125. package/dist/functions/src/math/atan2.spec.d.ts +2 -0
  126. package/dist/functions/src/math/atan2.spec.d.ts.map +1 -0
  127. package/dist/functions/src/math/base.d.ts +10 -0
  128. package/dist/functions/src/math/base.d.ts.map +1 -0
  129. package/dist/functions/src/math/base.spec.d.ts +2 -0
  130. package/dist/functions/src/math/base.spec.d.ts.map +1 -0
  131. package/dist/functions/src/math/cos.d.ts +9 -0
  132. package/dist/functions/src/math/cos.d.ts.map +1 -0
  133. package/dist/functions/src/math/cos.spec.d.ts +2 -0
  134. package/dist/functions/src/math/cos.spec.d.ts.map +1 -0
  135. package/dist/functions/src/math/countif.d.ts +9 -0
  136. package/dist/functions/src/math/countif.d.ts.map +1 -0
  137. package/dist/functions/src/math/countif.spec.d.ts +2 -0
  138. package/dist/functions/src/math/countif.spec.d.ts.map +1 -0
  139. package/dist/functions/src/math/countifs.d.ts +10 -0
  140. package/dist/functions/src/math/countifs.d.ts.map +1 -0
  141. package/dist/functions/src/math/countifs.spec.d.ts +2 -0
  142. package/dist/functions/src/math/countifs.spec.d.ts.map +1 -0
  143. package/dist/functions/src/math/even.d.ts +9 -0
  144. package/dist/functions/src/math/even.d.ts.map +1 -0
  145. package/dist/functions/src/math/even.spec.d.ts +2 -0
  146. package/dist/functions/src/math/even.spec.d.ts.map +1 -0
  147. package/dist/functions/src/math/exp.d.ts +10 -0
  148. package/dist/functions/src/math/exp.d.ts.map +1 -0
  149. package/dist/functions/src/math/exp.spec.d.ts +2 -0
  150. package/dist/functions/src/math/exp.spec.d.ts.map +1 -0
  151. package/dist/functions/src/math/fact.d.ts +9 -0
  152. package/dist/functions/src/math/fact.d.ts.map +1 -0
  153. package/dist/functions/src/math/fact.spec.d.ts +2 -0
  154. package/dist/functions/src/math/fact.spec.d.ts.map +1 -0
  155. package/dist/functions/src/math/index.d.ts +4 -0
  156. package/dist/functions/src/math/index.d.ts.map +1 -0
  157. package/dist/functions/src/math/int.d.ts +9 -0
  158. package/dist/functions/src/math/int.d.ts.map +1 -0
  159. package/dist/functions/src/math/int.spec.d.ts +2 -0
  160. package/dist/functions/src/math/int.spec.d.ts.map +1 -0
  161. package/dist/functions/src/math/iseven.d.ts +9 -0
  162. package/dist/functions/src/math/iseven.d.ts.map +1 -0
  163. package/dist/functions/src/math/iseven.spec.d.ts +2 -0
  164. package/dist/functions/src/math/iseven.spec.d.ts.map +1 -0
  165. package/dist/functions/src/math/isodd.d.ts +9 -0
  166. package/dist/functions/src/math/isodd.d.ts.map +1 -0
  167. package/dist/functions/src/math/isodd.spec.d.ts +2 -0
  168. package/dist/functions/src/math/isodd.spec.d.ts.map +1 -0
  169. package/dist/functions/src/math/lcm.d.ts +10 -0
  170. package/dist/functions/src/math/lcm.d.ts.map +1 -0
  171. package/dist/functions/src/math/lcm.spec.d.ts +2 -0
  172. package/dist/functions/src/math/lcm.spec.d.ts.map +1 -0
  173. package/dist/functions/src/math/ln.d.ts +9 -0
  174. package/dist/functions/src/math/ln.d.ts.map +1 -0
  175. package/dist/functions/src/math/ln.spec.d.ts +2 -0
  176. package/dist/functions/src/math/ln.spec.d.ts.map +1 -0
  177. package/dist/functions/src/math/log.d.ts +10 -0
  178. package/dist/functions/src/math/log.d.ts.map +1 -0
  179. package/dist/functions/src/math/log.spec.d.ts +2 -0
  180. package/dist/functions/src/math/log.spec.d.ts.map +1 -0
  181. package/dist/functions/src/math/log10.d.ts +9 -0
  182. package/dist/functions/src/math/log10.d.ts.map +1 -0
  183. package/dist/functions/src/math/log10.spec.d.ts +2 -0
  184. package/dist/functions/src/math/log10.spec.d.ts.map +1 -0
  185. package/dist/functions/src/math/mdeterm.d.ts +11 -0
  186. package/dist/functions/src/math/mdeterm.d.ts.map +1 -0
  187. package/dist/functions/src/math/minverse.d.ts +12 -0
  188. package/dist/functions/src/math/minverse.d.ts.map +1 -0
  189. package/dist/functions/src/math/mmult.d.ts +11 -0
  190. package/dist/functions/src/math/mmult.d.ts.map +1 -0
  191. package/dist/functions/src/math/mod.d.ts +10 -0
  192. package/dist/functions/src/math/mod.d.ts.map +1 -0
  193. package/dist/functions/src/math/mod.spec.d.ts +2 -0
  194. package/dist/functions/src/math/mod.spec.d.ts.map +1 -0
  195. package/dist/functions/src/math/odd.d.ts +9 -0
  196. package/dist/functions/src/math/odd.d.ts.map +1 -0
  197. package/dist/functions/src/math/odd.spec.d.ts +2 -0
  198. package/dist/functions/src/math/odd.spec.d.ts.map +1 -0
  199. package/dist/functions/src/math/pi.d.ts +9 -0
  200. package/dist/functions/src/math/pi.d.ts.map +1 -0
  201. package/dist/functions/src/math/pi.spec.d.ts +2 -0
  202. package/dist/functions/src/math/pi.spec.d.ts.map +1 -0
  203. package/dist/functions/src/math/product.d.ts +9 -0
  204. package/dist/functions/src/math/product.d.ts.map +1 -0
  205. package/dist/functions/src/math/product.spec.d.ts +2 -0
  206. package/dist/functions/src/math/product.spec.d.ts.map +1 -0
  207. package/dist/functions/src/math/radians.d.ts +9 -0
  208. package/dist/functions/src/math/radians.d.ts.map +1 -0
  209. package/dist/functions/src/math/radians.spec.d.ts +2 -0
  210. package/dist/functions/src/math/radians.spec.d.ts.map +1 -0
  211. package/dist/functions/src/math/rand.d.ts +9 -0
  212. package/dist/functions/src/math/rand.d.ts.map +1 -0
  213. package/dist/functions/src/math/rand.spec.d.ts +2 -0
  214. package/dist/functions/src/math/rand.spec.d.ts.map +1 -0
  215. package/dist/functions/src/math/round.d.ts +9 -0
  216. package/dist/functions/src/math/round.d.ts.map +1 -0
  217. package/dist/functions/src/math/round.spec.d.ts +2 -0
  218. package/dist/functions/src/math/round.spec.d.ts.map +1 -0
  219. package/dist/functions/src/math/rounddown.d.ts +9 -0
  220. package/dist/functions/src/math/rounddown.d.ts.map +1 -0
  221. package/dist/functions/src/math/rounddown.spec.d.ts +2 -0
  222. package/dist/functions/src/math/rounddown.spec.d.ts.map +1 -0
  223. package/dist/functions/src/math/roundup.d.ts +9 -0
  224. package/dist/functions/src/math/roundup.d.ts.map +1 -0
  225. package/dist/functions/src/math/roundup.spec.d.ts +2 -0
  226. package/dist/functions/src/math/roundup.spec.d.ts.map +1 -0
  227. package/dist/functions/src/math/sequence.d.ts +11 -0
  228. package/dist/functions/src/math/sequence.d.ts.map +1 -0
  229. package/dist/functions/src/math/sequence.spec.d.ts +2 -0
  230. package/dist/functions/src/math/sequence.spec.d.ts.map +1 -0
  231. package/dist/functions/src/math/sign.d.ts +9 -0
  232. package/dist/functions/src/math/sign.d.ts.map +1 -0
  233. package/dist/functions/src/math/sign.spec.d.ts +2 -0
  234. package/dist/functions/src/math/sign.spec.d.ts.map +1 -0
  235. package/dist/functions/src/math/sin.d.ts +9 -0
  236. package/dist/functions/src/math/sin.d.ts.map +1 -0
  237. package/dist/functions/src/math/sin.spec.d.ts +2 -0
  238. package/dist/functions/src/math/sin.spec.d.ts.map +1 -0
  239. package/dist/functions/src/math/sqrt.d.ts +9 -0
  240. package/dist/functions/src/math/sqrt.d.ts.map +1 -0
  241. package/dist/functions/src/math/sqrt.spec.d.ts +2 -0
  242. package/dist/functions/src/math/sqrt.spec.d.ts.map +1 -0
  243. package/dist/functions/src/math/sumif.d.ts +9 -0
  244. package/dist/functions/src/math/sumif.d.ts.map +1 -0
  245. package/dist/functions/src/math/sumifs.d.ts +10 -0
  246. package/dist/functions/src/math/sumifs.d.ts.map +1 -0
  247. package/dist/functions/src/math/sumifs.spec.d.ts +2 -0
  248. package/dist/functions/src/math/sumifs.spec.d.ts.map +1 -0
  249. package/dist/functions/src/math/sumproduct.d.ts +10 -0
  250. package/dist/functions/src/math/sumproduct.d.ts.map +1 -0
  251. package/dist/functions/src/math/sumsq.d.ts +9 -0
  252. package/dist/functions/src/math/sumsq.d.ts.map +1 -0
  253. package/dist/functions/src/math/sumsq.spec.d.ts +2 -0
  254. package/dist/functions/src/math/sumsq.spec.d.ts.map +1 -0
  255. package/dist/functions/src/math/tan.d.ts +9 -0
  256. package/dist/functions/src/math/tan.d.ts.map +1 -0
  257. package/dist/functions/src/math/tan.spec.d.ts +2 -0
  258. package/dist/functions/src/math/tan.spec.d.ts.map +1 -0
  259. package/dist/functions/src/math/transpose.d.ts +11 -0
  260. package/dist/functions/src/math/transpose.d.ts.map +1 -0
  261. package/dist/functions/src/math/trunc.d.ts +9 -0
  262. package/dist/functions/src/math/trunc.d.ts.map +1 -0
  263. package/dist/functions/src/math/trunc.spec.d.ts +2 -0
  264. package/dist/functions/src/math/trunc.spec.d.ts.map +1 -0
  265. package/dist/functions/src/math/unaryPercent.d.ts +9 -0
  266. package/dist/functions/src/math/unaryPercent.d.ts.map +1 -0
  267. package/dist/functions/src/math/unaryPercent.spec.d.ts +2 -0
  268. package/dist/functions/src/math/unaryPercent.spec.d.ts.map +1 -0
  269. package/dist/functions/src/math/uplus.d.ts +9 -0
  270. package/dist/functions/src/math/uplus.d.ts.map +1 -0
  271. package/dist/functions/src/math/uplus.spec.d.ts +2 -0
  272. package/dist/functions/src/math/uplus.spec.d.ts.map +1 -0
  273. package/dist/functions/src/statistics/averageif.d.ts +9 -0
  274. package/dist/functions/src/statistics/averageif.d.ts.map +1 -0
  275. package/dist/functions/src/statistics/averageifs.d.ts +10 -0
  276. package/dist/functions/src/statistics/averageifs.d.ts.map +1 -0
  277. package/dist/functions/src/statistics/averageifs.spec.d.ts +2 -0
  278. package/dist/functions/src/statistics/averageifs.spec.d.ts.map +1 -0
  279. package/dist/functions/src/statistics/correl.d.ts +10 -0
  280. package/dist/functions/src/statistics/correl.d.ts.map +1 -0
  281. package/dist/functions/src/statistics/correl.spec.d.ts +2 -0
  282. package/dist/functions/src/statistics/correl.spec.d.ts.map +1 -0
  283. package/dist/functions/src/statistics/covariance_p.d.ts +10 -0
  284. package/dist/functions/src/statistics/covariance_p.d.ts.map +1 -0
  285. package/dist/functions/src/statistics/covariance_p.spec.d.ts +2 -0
  286. package/dist/functions/src/statistics/covariance_p.spec.d.ts.map +1 -0
  287. package/dist/functions/src/statistics/covariance_s.d.ts +10 -0
  288. package/dist/functions/src/statistics/covariance_s.d.ts.map +1 -0
  289. package/dist/functions/src/statistics/covariance_s.spec.d.ts +2 -0
  290. package/dist/functions/src/statistics/covariance_s.spec.d.ts.map +1 -0
  291. package/dist/functions/src/statistics/index.d.ts +4 -0
  292. package/dist/functions/src/statistics/index.d.ts.map +1 -0
  293. package/dist/functions/src/statistics/median.d.ts +10 -0
  294. package/dist/functions/src/statistics/median.d.ts.map +1 -0
  295. package/dist/functions/src/statistics/median.spec.d.ts +2 -0
  296. package/dist/functions/src/statistics/median.spec.d.ts.map +1 -0
  297. package/dist/functions/src/statistics/mode_sngl.d.ts +10 -0
  298. package/dist/functions/src/statistics/mode_sngl.d.ts.map +1 -0
  299. package/dist/functions/src/statistics/mode_sngl.spec.d.ts +2 -0
  300. package/dist/functions/src/statistics/mode_sngl.spec.d.ts.map +1 -0
  301. package/dist/functions/src/statistics/percentile_inc.d.ts +10 -0
  302. package/dist/functions/src/statistics/percentile_inc.d.ts.map +1 -0
  303. package/dist/functions/src/statistics/percentile_inc.spec.d.ts +2 -0
  304. package/dist/functions/src/statistics/percentile_inc.spec.d.ts.map +1 -0
  305. package/dist/functions/src/statistics/quartile_inc.d.ts +10 -0
  306. package/dist/functions/src/statistics/quartile_inc.d.ts.map +1 -0
  307. package/dist/functions/src/statistics/quartile_inc.spec.d.ts +2 -0
  308. package/dist/functions/src/statistics/quartile_inc.spec.d.ts.map +1 -0
  309. package/dist/functions/src/statistics/rank_eq.d.ts +10 -0
  310. package/dist/functions/src/statistics/rank_eq.d.ts.map +1 -0
  311. package/dist/functions/src/statistics/rank_eq.spec.d.ts +2 -0
  312. package/dist/functions/src/statistics/rank_eq.spec.d.ts.map +1 -0
  313. package/dist/functions/src/statistics/rsq.d.ts +10 -0
  314. package/dist/functions/src/statistics/rsq.d.ts.map +1 -0
  315. package/dist/functions/src/statistics/rsq.spec.d.ts +2 -0
  316. package/dist/functions/src/statistics/rsq.spec.d.ts.map +1 -0
  317. package/dist/functions/src/statistics/stdev_p.d.ts +10 -0
  318. package/dist/functions/src/statistics/stdev_p.d.ts.map +1 -0
  319. package/dist/functions/src/statistics/stdev_p.spec.d.ts +2 -0
  320. package/dist/functions/src/statistics/stdev_p.spec.d.ts.map +1 -0
  321. package/dist/functions/src/statistics/stdev_s.d.ts +10 -0
  322. package/dist/functions/src/statistics/stdev_s.d.ts.map +1 -0
  323. package/dist/functions/src/statistics/stdev_s.spec.d.ts +2 -0
  324. package/dist/functions/src/statistics/stdev_s.spec.d.ts.map +1 -0
  325. package/dist/functions/src/statistics/t_test.d.ts +10 -0
  326. package/dist/functions/src/statistics/t_test.d.ts.map +1 -0
  327. package/dist/functions/src/statistics/t_test.spec.d.ts +2 -0
  328. package/dist/functions/src/statistics/t_test.spec.d.ts.map +1 -0
  329. package/dist/functions/src/statistics/var_p.d.ts +10 -0
  330. package/dist/functions/src/statistics/var_p.d.ts.map +1 -0
  331. package/dist/functions/src/statistics/var_p.spec.d.ts +2 -0
  332. package/dist/functions/src/statistics/var_p.spec.d.ts.map +1 -0
  333. package/dist/functions/src/statistics/var_s.d.ts +10 -0
  334. package/dist/functions/src/statistics/var_s.d.ts.map +1 -0
  335. package/dist/functions/src/statistics/var_s.spec.d.ts +2 -0
  336. package/dist/functions/src/statistics/var_s.spec.d.ts.map +1 -0
  337. package/dist/functions/src/text/char.d.ts +9 -0
  338. package/dist/functions/src/text/char.d.ts.map +1 -0
  339. package/dist/functions/src/text/char.spec.d.ts +2 -0
  340. package/dist/functions/src/text/char.spec.d.ts.map +1 -0
  341. package/dist/functions/src/text/clean.d.ts +9 -0
  342. package/dist/functions/src/text/clean.d.ts.map +1 -0
  343. package/dist/functions/src/text/clean.spec.d.ts +2 -0
  344. package/dist/functions/src/text/clean.spec.d.ts.map +1 -0
  345. package/dist/functions/src/text/concatenate.d.ts +9 -0
  346. package/dist/functions/src/text/concatenate.d.ts.map +1 -0
  347. package/dist/functions/src/text/concatenate.spec.d.ts +2 -0
  348. package/dist/functions/src/text/concatenate.spec.d.ts.map +1 -0
  349. package/dist/functions/src/text/exact.d.ts +9 -0
  350. package/dist/functions/src/text/exact.d.ts.map +1 -0
  351. package/dist/functions/src/text/exact.spec.d.ts +2 -0
  352. package/dist/functions/src/text/exact.spec.d.ts.map +1 -0
  353. package/dist/functions/src/text/index.d.ts +4 -0
  354. package/dist/functions/src/text/index.d.ts.map +1 -0
  355. package/dist/functions/src/text/join.d.ts +10 -0
  356. package/dist/functions/src/text/join.d.ts.map +1 -0
  357. package/dist/functions/src/text/join.spec.d.ts +2 -0
  358. package/dist/functions/src/text/join.spec.d.ts.map +1 -0
  359. package/dist/functions/src/text/lenb.d.ts +9 -0
  360. package/dist/functions/src/text/lenb.d.ts.map +1 -0
  361. package/dist/functions/src/text/lenb.spec.d.ts +2 -0
  362. package/dist/functions/src/text/lenb.spec.d.ts.map +1 -0
  363. package/dist/functions/src/text/lower.d.ts +9 -0
  364. package/dist/functions/src/text/lower.d.ts.map +1 -0
  365. package/dist/functions/src/text/lower.spec.d.ts +2 -0
  366. package/dist/functions/src/text/lower.spec.d.ts.map +1 -0
  367. package/dist/functions/src/text/proper.d.ts +9 -0
  368. package/dist/functions/src/text/proper.d.ts.map +1 -0
  369. package/dist/functions/src/text/proper.spec.d.ts +2 -0
  370. package/dist/functions/src/text/proper.spec.d.ts.map +1 -0
  371. package/dist/functions/src/text/replace.d.ts +10 -0
  372. package/dist/functions/src/text/replace.d.ts.map +1 -0
  373. package/dist/functions/src/text/replace.spec.d.ts +2 -0
  374. package/dist/functions/src/text/replace.spec.d.ts.map +1 -0
  375. package/dist/functions/src/text/rept.d.ts +10 -0
  376. package/dist/functions/src/text/rept.d.ts.map +1 -0
  377. package/dist/functions/src/text/rept.spec.d.ts +2 -0
  378. package/dist/functions/src/text/rept.spec.d.ts.map +1 -0
  379. package/dist/functions/src/text/trim.d.ts +9 -0
  380. package/dist/functions/src/text/trim.d.ts.map +1 -0
  381. package/dist/functions/src/text/trim.spec.d.ts +2 -0
  382. package/dist/functions/src/text/trim.spec.d.ts.map +1 -0
  383. package/dist/functions/src/text/unichar.d.ts +9 -0
  384. package/dist/functions/src/text/unichar.d.ts.map +1 -0
  385. package/dist/functions/src/text/unichar.spec.d.ts +2 -0
  386. package/dist/functions/src/text/unichar.spec.d.ts.map +1 -0
  387. package/dist/functions/src/text/unicode.d.ts +9 -0
  388. package/dist/functions/src/text/unicode.d.ts.map +1 -0
  389. package/dist/functions/src/text/unicode.spec.d.ts +2 -0
  390. package/dist/functions/src/text/unicode.spec.d.ts.map +1 -0
  391. package/dist/functions/src/text/upper.d.ts +9 -0
  392. package/dist/functions/src/text/upper.d.ts.map +1 -0
  393. package/dist/functions/src/text/upper.spec.d.ts +2 -0
  394. package/dist/functions/src/text/upper.spec.d.ts.map +1 -0
  395. package/dist/functions/src/time/date.d.ts +9 -0
  396. package/dist/functions/src/time/date.d.ts.map +1 -0
  397. package/dist/functions/src/time/day.d.ts +9 -0
  398. package/dist/functions/src/time/day.d.ts.map +1 -0
  399. package/dist/functions/src/time/days.d.ts +9 -0
  400. package/dist/functions/src/time/days.d.ts.map +1 -0
  401. package/dist/functions/src/time/hour.d.ts +9 -0
  402. package/dist/functions/src/time/hour.d.ts.map +1 -0
  403. package/dist/functions/src/time/index.d.ts +4 -0
  404. package/dist/functions/src/time/index.d.ts.map +1 -0
  405. package/dist/functions/src/time/minute.d.ts +9 -0
  406. package/dist/functions/src/time/minute.d.ts.map +1 -0
  407. package/dist/functions/src/time/month.d.ts +9 -0
  408. package/dist/functions/src/time/month.d.ts.map +1 -0
  409. package/dist/functions/src/time/second.d.ts +9 -0
  410. package/dist/functions/src/time/second.d.ts.map +1 -0
  411. package/dist/functions/src/time/time.d.ts +9 -0
  412. package/dist/functions/src/time/time.d.ts.map +1 -0
  413. package/dist/functions/src/time/today.d.ts +9 -0
  414. package/dist/functions/src/time/today.d.ts.map +1 -0
  415. package/dist/functions/src/time/workday.d.ts +9 -0
  416. package/dist/functions/src/time/workday.d.ts.map +1 -0
  417. package/dist/functions/src/time/year.d.ts +9 -0
  418. package/dist/functions/src/time/year.d.ts.map +1 -0
  419. package/dist/functions/src/types.d.ts +2 -0
  420. package/dist/functions/src/types.d.ts.map +1 -0
  421. package/dist/index.d.ts +6 -0
  422. package/dist/index.js +321 -0
  423. package/dist/index.js.map +1 -0
  424. package/dist/lookup/index.d.ts +6 -0
  425. package/dist/lookup/index.js +360 -0
  426. package/dist/lookup/index.js.map +1 -0
  427. package/dist/math/index.d.ts +6 -0
  428. package/dist/math/index.js +1021 -0
  429. package/dist/math/index.js.map +1 -0
  430. package/dist/statistics/index.d.ts +6 -0
  431. package/dist/statistics/index.js +706 -0
  432. package/dist/statistics/index.js.map +1 -0
  433. package/dist/text/index.d.ts +6 -0
  434. package/dist/text/index.js +258 -0
  435. package/dist/text/index.js.map +1 -0
  436. package/dist/time/index.d.ts +6 -0
  437. package/dist/time/index.js +194 -0
  438. package/dist/time/index.js.map +1 -0
  439. package/package.json +85 -0
@@ -0,0 +1,706 @@
1
+ import { BaseFunction as y, conditionArg as b, ensureString as M, eachMatrix as m, stripMatrix as T, check as R, FormulaError as d, Sheet as w, createBooleanMask as q, ensureNumber as f } from "@gridsheet/core";
2
+ const k = "Returns the average of a series of cells that meet a condition.";
3
+ class S extends y {
4
+ constructor() {
5
+ super(...arguments), this.example = 'AVERAGEIF(A1:A10,">20")', this.description = k, this.defs = [
6
+ { name: "range", description: "A condition range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
7
+ b,
8
+ {
9
+ name: "average_range",
10
+ description: "A range to be averaged.",
11
+ takesMatrix: !0,
12
+ acceptedTypes: ["matrix"],
13
+ optional: !0
14
+ }
15
+ ], this.category = "statistics";
16
+ }
17
+ main(t, n, r) {
18
+ const e = M(n), a = [], i = [];
19
+ m(
20
+ t,
21
+ (s) => {
22
+ a.push(s);
23
+ },
24
+ this.at
25
+ ), r && m(
26
+ r,
27
+ (s) => {
28
+ i.push(s);
29
+ },
30
+ this.at
31
+ );
32
+ let c = 0, o = 0;
33
+ if (a.forEach((s, l) => {
34
+ const h = T((r ? i[l] : s) ?? 0, this.at);
35
+ typeof h == "number" && R(s, e) && (c += h, o++);
36
+ }), o === 0)
37
+ throw new d("#DIV/0!", "No cells match the condition.");
38
+ return c / o;
39
+ }
40
+ }
41
+ const I = "Returns the average of a range depending on multiple criteria.";
42
+ class V extends y {
43
+ constructor() {
44
+ super(...arguments), this.example = 'AVERAGEIFS(A1:A10, B1:B10, ">20")', this.description = I, this.defs = [
45
+ { name: "average_range", description: "The range to be averaged.", takesMatrix: !0, acceptedTypes: ["matrix"] },
46
+ { name: "range1", description: "First condition range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
47
+ { ...b, name: "condition1" },
48
+ {
49
+ name: "range2",
50
+ description: "Additional condition range.",
51
+ takesMatrix: !0,
52
+ acceptedTypes: ["matrix"],
53
+ optional: !0,
54
+ variadic: !0
55
+ },
56
+ { ...b, name: "condition2", optional: !0, variadic: !0 }
57
+ ], this.category = "statistics";
58
+ }
59
+ validate(t) {
60
+ const n = super.validate(t);
61
+ if ((n.length - 1) % 2 !== 0)
62
+ throw new d("#N/A", "AVERAGEIFS requires average_range and at least one range/condition pair.");
63
+ if (!(n[0] instanceof w))
64
+ throw new d("#VALUE!", "First argument of AVERAGEIFS must be a range.");
65
+ const r = n[0].numRows, e = n[0].numCols, a = [], i = [];
66
+ for (let s = 1; s < n.length; s += 2) {
67
+ if (!(n[s] instanceof w))
68
+ throw new d("#VALUE!", `Argument ${s + 1} of AVERAGEIFS must be a range.`);
69
+ if (n[s].numRows !== r || n[s].numCols !== e)
70
+ throw new d("#VALUE!", "Array arguments to AVERAGEIFS are of different size.");
71
+ a.push(n[s]), i.push(M(n[s + 1]));
72
+ }
73
+ const c = n[0], o = q(a, i, this.at);
74
+ return [c, o];
75
+ }
76
+ main(t, n) {
77
+ let r = 0, e = 0;
78
+ return m(
79
+ t,
80
+ (a, i) => {
81
+ if (i && n[i.y][i.x]) {
82
+ const c = T(a ?? 0, this.at);
83
+ typeof c == "number" && (r += c, e++);
84
+ }
85
+ },
86
+ this.at
87
+ ), e === 0 ? new d("#DIV/0!", "No matching cells found for AVERAGEIFS.") : r / e;
88
+ }
89
+ }
90
+ const F = "Returns the median value in a numeric dataset.";
91
+ class C extends y {
92
+ constructor() {
93
+ super(...arguments), this.example = "MEDIAN(A1:A100)", this.description = F, this.defs = [
94
+ {
95
+ name: "value",
96
+ description: "Numbers or ranges to compute the median of.",
97
+ takesMatrix: !0,
98
+ acceptedTypes: ["number", "matrix"],
99
+ variadic: !0
100
+ }
101
+ ], this.category = "statistics";
102
+ }
103
+ validate(t) {
104
+ const n = [];
105
+ for (const r of t)
106
+ m(
107
+ r,
108
+ (e) => {
109
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
110
+ },
111
+ this.at
112
+ );
113
+ if (n.length === 0)
114
+ throw new d("#NUM!", "MEDIAN requires at least one numeric value.");
115
+ return [n];
116
+ }
117
+ main(t) {
118
+ t.sort((r, e) => r - e);
119
+ const n = Math.floor(t.length / 2);
120
+ return t.length % 2 === 0 ? (t[n - 1] + t[n]) / 2 : t[n];
121
+ }
122
+ }
123
+ const D = "Returns the standard deviation based on a sample.";
124
+ class B extends y {
125
+ constructor() {
126
+ super(...arguments), this.example = "STDEV.S(A1:A100)", this.description = D, this.defs = [
127
+ {
128
+ name: "value",
129
+ description: "Numbers or ranges representing the sample.",
130
+ takesMatrix: !0,
131
+ acceptedTypes: ["number", "matrix"],
132
+ variadic: !0
133
+ }
134
+ ], this.category = "statistics";
135
+ }
136
+ validate(t) {
137
+ const n = [];
138
+ for (const r of t)
139
+ m(
140
+ r,
141
+ (e) => {
142
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
143
+ },
144
+ this.at
145
+ );
146
+ if (n.length < 2)
147
+ throw new d("#DIV/0!", "STDEV.S requires at least 2 numeric values.");
148
+ return [n];
149
+ }
150
+ main(t) {
151
+ const n = t.reduce((e, a) => e + a, 0) / t.length, r = t.reduce((e, a) => e + (a - n) ** 2, 0) / (t.length - 1);
152
+ return Math.sqrt(r);
153
+ }
154
+ }
155
+ const P = "Returns the standard deviation based on the entire population.";
156
+ class $ extends y {
157
+ constructor() {
158
+ super(...arguments), this.example = "STDEV.P(A1:A100)", this.description = P, this.defs = [
159
+ {
160
+ name: "value",
161
+ description: "Numbers or ranges representing the entire population.",
162
+ takesMatrix: !0,
163
+ acceptedTypes: ["number", "matrix"],
164
+ variadic: !0
165
+ }
166
+ ], this.category = "statistics";
167
+ }
168
+ validate(t) {
169
+ const n = [];
170
+ for (const r of t)
171
+ m(
172
+ r,
173
+ (e) => {
174
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
175
+ },
176
+ this.at
177
+ );
178
+ if (n.length < 1)
179
+ throw new d("#DIV/0!", "STDEV.P requires at least 1 numeric value.");
180
+ return [n];
181
+ }
182
+ main(t) {
183
+ const n = t.reduce((e, a) => e + a, 0) / t.length, r = t.reduce((e, a) => e + (a - n) ** 2, 0) / t.length;
184
+ return Math.sqrt(r);
185
+ }
186
+ }
187
+ const U = "Returns the variance based on a sample.";
188
+ class _ extends y {
189
+ constructor() {
190
+ super(...arguments), this.example = "VAR.S(A1:A100)", this.description = U, this.defs = [
191
+ {
192
+ name: "value",
193
+ description: "Numbers or ranges representing the sample.",
194
+ takesMatrix: !0,
195
+ acceptedTypes: ["number", "matrix"],
196
+ variadic: !0
197
+ }
198
+ ], this.category = "statistics";
199
+ }
200
+ validate(t) {
201
+ const n = [];
202
+ for (const r of t)
203
+ m(
204
+ r,
205
+ (e) => {
206
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
207
+ },
208
+ this.at
209
+ );
210
+ if (n.length < 2)
211
+ throw new d("#DIV/0!", "VAR.S requires at least 2 numeric values.");
212
+ return [n];
213
+ }
214
+ main(t) {
215
+ const n = t.reduce((r, e) => r + e, 0) / t.length;
216
+ return t.reduce((r, e) => r + (e - n) ** 2, 0) / (t.length - 1);
217
+ }
218
+ }
219
+ const L = "Returns the variance based on the entire population.";
220
+ class Q extends y {
221
+ constructor() {
222
+ super(...arguments), this.example = "VAR.P(A1:A100)", this.description = L, this.defs = [
223
+ {
224
+ name: "value",
225
+ description: "Numbers or ranges representing the entire population.",
226
+ takesMatrix: !0,
227
+ acceptedTypes: ["number", "matrix"],
228
+ variadic: !0
229
+ }
230
+ ], this.category = "statistics";
231
+ }
232
+ validate(t) {
233
+ const n = [];
234
+ for (const r of t)
235
+ m(
236
+ r,
237
+ (e) => {
238
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
239
+ },
240
+ this.at
241
+ );
242
+ if (n.length < 1)
243
+ throw new d("#DIV/0!", "VAR.P requires at least 1 numeric value.");
244
+ return [n];
245
+ }
246
+ main(t) {
247
+ const n = t.reduce((r, e) => r + e, 0) / t.length;
248
+ return t.reduce((r, e) => r + (e - n) ** 2, 0) / t.length;
249
+ }
250
+ }
251
+ const G = "Returns the k-th percentile of values in a range, where k is in the range 0 to 1, inclusive.";
252
+ class O extends y {
253
+ constructor() {
254
+ super(...arguments), this.example = "PERCENTILE.INC(A1:A100, 0.9)", this.description = G, this.defs = [
255
+ {
256
+ name: "data",
257
+ description: "The array or range of data to consider.",
258
+ takesMatrix: !0,
259
+ acceptedTypes: ["matrix"]
260
+ },
261
+ { name: "percentile", description: "The percentile value between 0 and 1, inclusive.", acceptedTypes: ["number"] }
262
+ ], this.category = "statistics";
263
+ }
264
+ validate(t) {
265
+ const n = f(t[1]);
266
+ if (n < 0 || n > 1)
267
+ throw new d("#NUM!", "Percentile must be between 0 and 1.");
268
+ const r = [];
269
+ if (m(
270
+ t[0],
271
+ (e) => {
272
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && r.push(f(e));
273
+ },
274
+ this.at
275
+ ), r.length === 0)
276
+ throw new d("#NUM!", "PERCENTILE.INC requires at least one numeric value.");
277
+ return [r, n];
278
+ }
279
+ main(t, n) {
280
+ t.sort((i, c) => i - c);
281
+ const r = n * (t.length - 1), e = Math.floor(r), a = Math.ceil(r);
282
+ return t[e] + (t[a] - t[e]) * (r - e);
283
+ }
284
+ }
285
+ const v = "Returns the quartile of a dataset, based on percentile values from 0 to 1, inclusive.";
286
+ class X extends y {
287
+ constructor() {
288
+ super(...arguments), this.example = "QUARTILE.INC(A1:A100, 1)", this.description = v, this.defs = [
289
+ {
290
+ name: "data",
291
+ description: "The array or range of data to consider.",
292
+ takesMatrix: !0,
293
+ acceptedTypes: ["matrix"]
294
+ },
295
+ {
296
+ name: "quartile_number",
297
+ description: "Which quartile to return: 0 (min), 1 (Q1), 2 (median), 3 (Q3), 4 (max).",
298
+ acceptedTypes: ["number"]
299
+ }
300
+ ], this.category = "statistics";
301
+ }
302
+ validate(t) {
303
+ const n = Math.floor(f(t[1]));
304
+ if (n < 0 || n > 4)
305
+ throw new d("#NUM!", "Quartile number must be between 0 and 4.");
306
+ const r = [];
307
+ if (m(
308
+ t[0],
309
+ (e) => {
310
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && r.push(f(e));
311
+ },
312
+ this.at
313
+ ), r.length === 0)
314
+ throw new d("#NUM!", "QUARTILE.INC requires at least one numeric value.");
315
+ return [r, n];
316
+ }
317
+ main(t, n) {
318
+ t.sort((c, o) => c - o);
319
+ const e = n / 4 * (t.length - 1), a = Math.floor(e), i = Math.ceil(e);
320
+ return t[a] + (t[i] - t[a]) * (e - a);
321
+ }
322
+ }
323
+ const Y = "Returns the rank of a number in a list of numbers. If more than one value has the same rank, the top rank of that set of values is returned.";
324
+ class K extends y {
325
+ constructor() {
326
+ super(...arguments), this.example = "RANK.EQ(A1, A1:A100)", this.description = Y, this.defs = [
327
+ { name: "value", description: "The value whose rank will be determined.", acceptedTypes: ["number"] },
328
+ {
329
+ name: "data",
330
+ description: "The array or range of data to consider.",
331
+ takesMatrix: !0,
332
+ acceptedTypes: ["matrix"]
333
+ },
334
+ {
335
+ name: "is_ascending",
336
+ description: "Whether to rank in ascending order. Default is FALSE (descending).",
337
+ acceptedTypes: ["boolean"],
338
+ optional: !0
339
+ }
340
+ ], this.category = "statistics";
341
+ }
342
+ validate(t) {
343
+ const n = f(t[0]), r = [];
344
+ if (m(
345
+ t[1],
346
+ (a) => {
347
+ a == null || a === "" || typeof a == "boolean" || (typeof a == "number" || typeof a == "string" && !isNaN(Number(a))) && r.push(f(a));
348
+ },
349
+ this.at
350
+ ), r.length === 0)
351
+ throw new d("#NUM!", "RANK.EQ requires at least one numeric value in data.");
352
+ if (!r.includes(n))
353
+ throw new d("#N/A", "Value not found in data range.");
354
+ const e = t[2] ?? !1;
355
+ return [n, r, e];
356
+ }
357
+ main(t, n, r) {
358
+ return n.sort((e, a) => r ? e - a : a - e), n.indexOf(t) + 1;
359
+ }
360
+ }
361
+ const W = "Returns the correlation coefficient of two datasets.";
362
+ class j extends y {
363
+ constructor() {
364
+ super(...arguments), this.example = "CORREL(A1:A100, B1:B100)", this.description = W, this.defs = [
365
+ {
366
+ name: "data_y",
367
+ description: "The range representing the dependent data.",
368
+ takesMatrix: !0,
369
+ acceptedTypes: ["matrix"]
370
+ },
371
+ {
372
+ name: "data_x",
373
+ description: "The range representing the independent data.",
374
+ takesMatrix: !0,
375
+ acceptedTypes: ["matrix"]
376
+ }
377
+ ], this.category = "statistics";
378
+ }
379
+ validate(t) {
380
+ const n = [], r = [];
381
+ if (m(
382
+ t[0],
383
+ (e) => {
384
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
385
+ },
386
+ this.at
387
+ ), m(
388
+ t[1],
389
+ (e) => {
390
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && r.push(f(e));
391
+ },
392
+ this.at
393
+ ), n.length !== r.length || n.length < 2)
394
+ throw new d("#N/A", "CORREL requires two ranges of equal length with at least 2 values.");
395
+ return [n, r];
396
+ }
397
+ main(t, n) {
398
+ const r = t.length, e = t.reduce((l, h) => l + h, 0) / r, a = n.reduce((l, h) => l + h, 0) / r;
399
+ let i = 0, c = 0, o = 0;
400
+ for (let l = 0; l < r; l++) {
401
+ const h = t[l] - e, p = n[l] - a;
402
+ i += h * p, c += h * h, o += p * p;
403
+ }
404
+ const s = Math.sqrt(c * o);
405
+ if (s === 0)
406
+ throw new d("#DIV/0!", "Standard deviation of one dataset is zero.");
407
+ return i / s;
408
+ }
409
+ }
410
+ const H = "Returns the sample covariance, the average of the products of deviations for each data point pair in two datasets.";
411
+ class J extends y {
412
+ constructor() {
413
+ super(...arguments), this.example = "COVARIANCE.S(A1:A100, B1:B100)", this.description = H, this.defs = [
414
+ {
415
+ name: "data_y",
416
+ description: "The range representing the first dataset.",
417
+ takesMatrix: !0,
418
+ acceptedTypes: ["matrix"]
419
+ },
420
+ {
421
+ name: "data_x",
422
+ description: "The range representing the second dataset.",
423
+ takesMatrix: !0,
424
+ acceptedTypes: ["matrix"]
425
+ }
426
+ ], this.category = "statistics";
427
+ }
428
+ validate(t) {
429
+ const n = [], r = [];
430
+ if (m(
431
+ t[0],
432
+ (e) => {
433
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
434
+ },
435
+ this.at
436
+ ), m(
437
+ t[1],
438
+ (e) => {
439
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && r.push(f(e));
440
+ },
441
+ this.at
442
+ ), n.length !== r.length || n.length < 2)
443
+ throw new d("#N/A", "COVARIANCE.S requires two ranges of equal length with at least 2 values.");
444
+ return [n, r];
445
+ }
446
+ main(t, n) {
447
+ const r = t.length, e = t.reduce((i, c) => i + c, 0) / r, a = n.reduce((i, c) => i + c, 0) / r;
448
+ return t.reduce((i, c, o) => i + (c - e) * (n[o] - a), 0) / (r - 1);
449
+ }
450
+ }
451
+ const Z = "Returns the population covariance, the average of the products of deviations for each data point pair in two datasets.";
452
+ class z extends y {
453
+ constructor() {
454
+ super(...arguments), this.example = "COVARIANCE.P(A1:A100, B1:B100)", this.description = Z, this.defs = [
455
+ {
456
+ name: "data_y",
457
+ description: "The range representing the first dataset.",
458
+ takesMatrix: !0,
459
+ acceptedTypes: ["matrix"]
460
+ },
461
+ {
462
+ name: "data_x",
463
+ description: "The range representing the second dataset.",
464
+ takesMatrix: !0,
465
+ acceptedTypes: ["matrix"]
466
+ }
467
+ ], this.category = "statistics";
468
+ }
469
+ validate(t) {
470
+ const n = [], r = [];
471
+ if (m(
472
+ t[0],
473
+ (e) => {
474
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
475
+ },
476
+ this.at
477
+ ), m(
478
+ t[1],
479
+ (e) => {
480
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && r.push(f(e));
481
+ },
482
+ this.at
483
+ ), n.length !== r.length || n.length < 1)
484
+ throw new d("#N/A", "COVARIANCE.P requires two ranges of equal length with at least 1 value.");
485
+ return [n, r];
486
+ }
487
+ main(t, n) {
488
+ const r = t.length, e = t.reduce((i, c) => i + c, 0) / r, a = n.reduce((i, c) => i + c, 0) / r;
489
+ return t.reduce((i, c, o) => i + (c - e) * (n[o] - a), 0) / r;
490
+ }
491
+ }
492
+ const ee = "Returns the most commonly occurring value in a dataset. If there are multiple modes, the smallest is returned.";
493
+ class te extends y {
494
+ constructor() {
495
+ super(...arguments), this.example = "MODE.SNGL(A1:A100)", this.description = ee, this.defs = [
496
+ {
497
+ name: "value",
498
+ description: "Numbers or ranges to compute the mode of.",
499
+ takesMatrix: !0,
500
+ acceptedTypes: ["number", "matrix"],
501
+ variadic: !0
502
+ }
503
+ ], this.category = "statistics";
504
+ }
505
+ validate(t) {
506
+ const n = [];
507
+ for (const r of t)
508
+ m(
509
+ r,
510
+ (e) => {
511
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
512
+ },
513
+ this.at
514
+ );
515
+ if (n.length === 0)
516
+ throw new d("#N/A", "MODE.SNGL requires at least one numeric value.");
517
+ return [n];
518
+ }
519
+ main(t) {
520
+ const n = /* @__PURE__ */ new Map();
521
+ for (const a of t)
522
+ n.set(a, (n.get(a) ?? 0) + 1);
523
+ const r = Math.max(...n.values());
524
+ if (r < 2)
525
+ throw new d("#N/A", "No value appears more than once.");
526
+ const e = [...n.entries()].filter(([, a]) => a === r).map(([a]) => a);
527
+ return Math.min(...e);
528
+ }
529
+ }
530
+ const ne = "Returns the square of the Pearson product-moment correlation coefficient (R²).";
531
+ class re extends y {
532
+ constructor() {
533
+ super(...arguments), this.example = "RSQ(A1:A10, B1:B10)", this.description = ne, this.defs = [
534
+ {
535
+ name: "data_y",
536
+ description: "The range representing the dependent data.",
537
+ takesMatrix: !0,
538
+ acceptedTypes: ["matrix"]
539
+ },
540
+ {
541
+ name: "data_x",
542
+ description: "The range representing the independent data.",
543
+ takesMatrix: !0,
544
+ acceptedTypes: ["matrix"]
545
+ }
546
+ ], this.category = "statistics";
547
+ }
548
+ validate(t) {
549
+ const n = [], r = [];
550
+ if (m(
551
+ t[0],
552
+ (e) => {
553
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && n.push(f(e));
554
+ },
555
+ this.at
556
+ ), m(
557
+ t[1],
558
+ (e) => {
559
+ e == null || e === "" || typeof e == "boolean" || (typeof e == "number" || typeof e == "string" && !isNaN(Number(e))) && r.push(f(e));
560
+ },
561
+ this.at
562
+ ), n.length !== r.length)
563
+ throw new d("#N/A", "RSQ requires two ranges of equal length.");
564
+ if (n.length < 2)
565
+ throw new d("#N/A", "RSQ requires at least 2 data points.");
566
+ return [n, r];
567
+ }
568
+ main(t, n) {
569
+ const r = t.length, e = t.reduce((h, p) => h + p, 0) / r, a = n.reduce((h, p) => h + p, 0) / r;
570
+ let i = 0, c = 0, o = 0;
571
+ for (let h = 0; h < r; h++) {
572
+ const p = t[h] - e, g = n[h] - a;
573
+ i += p * g, c += p * p, o += g * g;
574
+ }
575
+ const s = Math.sqrt(c * o);
576
+ if (s === 0)
577
+ throw new d("#DIV/0!", "Standard deviation of one dataset is zero.");
578
+ const l = i / s;
579
+ return l * l;
580
+ }
581
+ }
582
+ const ae = `Returns the probability associated with a Student's t-test.
583
+ tails: 1 (one-tailed) or 2 (two-tailed).
584
+ type: 1 (paired), 2 (two-sample equal variance), 3 (two-sample unequal variance).`;
585
+ function E(u, t, n) {
586
+ if (u <= 0)
587
+ return 0;
588
+ if (u >= 1)
589
+ return 1;
590
+ if (u > (t + 1) / (t + n + 2))
591
+ return 1 - E(1 - u, n, t);
592
+ const r = x(t) + x(n) - x(t + n), e = Math.exp(Math.log(u) * t + Math.log(1 - u) * n - r) / t, a = 200, i = 3e-7;
593
+ let c = 1, o = 1, s = 1 - (t + n) * u / (t + 1);
594
+ Math.abs(s) < 1e-30 && (s = 1e-30), s = 1 / s, c = s;
595
+ for (let l = 1; l <= a; l++) {
596
+ let h = l * (n - l) * u / ((t + 2 * l - 1) * (t + 2 * l));
597
+ s = 1 + h * s, Math.abs(s) < 1e-30 && (s = 1e-30), o = 1 + h / o, Math.abs(o) < 1e-30 && (o = 1e-30), s = 1 / s, c *= s * o, h = -(t + l) * (t + n + l) * u / ((t + 2 * l) * (t + 2 * l + 1)), s = 1 + h * s, Math.abs(s) < 1e-30 && (s = 1e-30), o = 1 + h / o, Math.abs(o) < 1e-30 && (o = 1e-30), s = 1 / s;
598
+ const p = s * o;
599
+ if (c *= p, Math.abs(p - 1) < i)
600
+ break;
601
+ }
602
+ return e * c;
603
+ }
604
+ function x(u) {
605
+ const n = [
606
+ 0.9999999999998099,
607
+ 676.5203681218851,
608
+ -1259.1392167224028,
609
+ 771.3234287776531,
610
+ -176.6150291621406,
611
+ 12.507343278686905,
612
+ -0.13857109526572012,
613
+ 9984369578019572e-21,
614
+ 15056327351493116e-23
615
+ ];
616
+ if (u < 0.5)
617
+ return Math.log(Math.PI / Math.sin(Math.PI * u)) - x(1 - u);
618
+ u--;
619
+ let r = n[0];
620
+ for (let a = 1; a < 9; a++)
621
+ r += n[a] / (u + a);
622
+ const e = u + 7 + 0.5;
623
+ return 0.5 * Math.log(2 * Math.PI) + (u + 0.5) * Math.log(e) - e + Math.log(r);
624
+ }
625
+ function se(u, t) {
626
+ const n = t / (t + u * u);
627
+ return E(n, t / 2, 0.5);
628
+ }
629
+ class ie extends y {
630
+ constructor() {
631
+ super(...arguments), this.example = "T.TEST(A1:A100, B1:B100, 2, 2)", this.description = ae, this.defs = [
632
+ { name: "range1", description: "The first sample of data.", takesMatrix: !0, acceptedTypes: ["matrix"] },
633
+ { name: "range2", description: "The second sample of data.", takesMatrix: !0, acceptedTypes: ["matrix"] },
634
+ { name: "tails", description: "The number of distribution tails: 1 or 2.", acceptedTypes: ["number"] },
635
+ {
636
+ name: "type",
637
+ description: "The type of t-test: 1 (paired), 2 (equal variance), 3 (unequal variance).",
638
+ acceptedTypes: ["number"]
639
+ }
640
+ ], this.category = "statistics";
641
+ }
642
+ validate(t) {
643
+ const n = Math.floor(f(t[2])), r = Math.floor(f(t[3]));
644
+ if (n !== 1 && n !== 2)
645
+ throw new d("#NUM!", "tails must be 1 or 2.");
646
+ if (r < 1 || r > 3)
647
+ throw new d("#NUM!", "type must be 1, 2, or 3.");
648
+ const e = [], a = [];
649
+ if (m(
650
+ t[0],
651
+ (i) => {
652
+ i == null || i === "" || typeof i == "boolean" || e.push(f(i));
653
+ },
654
+ this.at
655
+ ), m(
656
+ t[1],
657
+ (i) => {
658
+ i == null || i === "" || typeof i == "boolean" || a.push(f(i));
659
+ },
660
+ this.at
661
+ ), r === 1) {
662
+ if (e.length !== a.length || e.length < 2)
663
+ throw new d("#N/A", "Paired T.TEST requires equal-length ranges with at least 2 values.");
664
+ } else if (e.length < 2 || a.length < 2)
665
+ throw new d("#DIV/0!", `T.TEST type ${r} requires at least 2 values per range.`);
666
+ return [e, a, n, r];
667
+ }
668
+ main(t, n, r, e) {
669
+ let a, i;
670
+ if (e === 1) {
671
+ const o = t.map((p, g) => p - n[g]), s = o.length, l = o.reduce((p, g) => p + g, 0) / s, h = o.reduce((p, g) => p + (g - l) ** 2, 0) / (s - 1);
672
+ a = l / Math.sqrt(h / s), i = s - 1;
673
+ } else if (e === 2) {
674
+ const o = t.reduce((g, A) => g + A, 0) / t.length, s = n.reduce((g, A) => g + A, 0) / n.length, l = t.reduce((g, A) => g + (A - o) ** 2, 0) / (t.length - 1), h = n.reduce((g, A) => g + (A - s) ** 2, 0) / (n.length - 1), p = ((t.length - 1) * l + (n.length - 1) * h) / (t.length + n.length - 2);
675
+ a = (o - s) / Math.sqrt(p * (1 / t.length + 1 / n.length)), i = t.length + n.length - 2;
676
+ } else {
677
+ const o = t.reduce((A, N) => A + N, 0) / t.length, s = n.reduce((A, N) => A + N, 0) / n.length, l = t.reduce((A, N) => A + (N - o) ** 2, 0) / (t.length - 1), h = n.reduce((A, N) => A + (N - s) ** 2, 0) / (n.length - 1), p = l / t.length, g = h / n.length;
678
+ a = (o - s) / Math.sqrt(p + g), i = (p + g) ** 2 / (p ** 2 / (t.length - 1) + g ** 2 / (n.length - 1));
679
+ }
680
+ const c = se(Math.abs(a), i);
681
+ return r === 1 ? c / 2 : c;
682
+ }
683
+ }
684
+ const ce = {
685
+ averageif: S,
686
+ averageifs: V,
687
+ median: C,
688
+ "stdev.s": B,
689
+ "stdev.p": $,
690
+ "var.s": _,
691
+ "var.p": Q,
692
+ "percentile.inc": O,
693
+ "quartile.inc": X,
694
+ "rank.eq": K,
695
+ correl: j,
696
+ "covariance.s": J,
697
+ "covariance.p": z,
698
+ "mode.sngl": te,
699
+ rsq: re,
700
+ "t.test": ie
701
+ };
702
+ export {
703
+ ce as default,
704
+ ce as statisticsFunctions
705
+ };
706
+ //# sourceMappingURL=index.js.map