@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.
- package/LICENSE +190 -0
- package/README.md +75 -0
- package/dist/functions/src/index.d.ts +7 -0
- package/dist/functions/src/index.d.ts.map +1 -0
- package/dist/functions/src/information/index.d.ts +4 -0
- package/dist/functions/src/information/index.d.ts.map +1 -0
- package/dist/functions/src/information/isblank.d.ts +9 -0
- package/dist/functions/src/information/isblank.d.ts.map +1 -0
- package/dist/functions/src/information/isblank.spec.d.ts +2 -0
- package/dist/functions/src/information/isblank.spec.d.ts.map +1 -0
- package/dist/functions/src/information/isdate.d.ts +9 -0
- package/dist/functions/src/information/isdate.d.ts.map +1 -0
- package/dist/functions/src/information/isdate.spec.d.ts +2 -0
- package/dist/functions/src/information/isdate.spec.d.ts.map +1 -0
- package/dist/functions/src/information/isemail.d.ts +9 -0
- package/dist/functions/src/information/isemail.d.ts.map +1 -0
- package/dist/functions/src/information/isemail.spec.d.ts +2 -0
- package/dist/functions/src/information/isemail.spec.d.ts.map +1 -0
- package/dist/functions/src/information/iserr.d.ts +9 -0
- package/dist/functions/src/information/iserr.d.ts.map +1 -0
- package/dist/functions/src/information/iserr.spec.d.ts +2 -0
- package/dist/functions/src/information/iserr.spec.d.ts.map +1 -0
- package/dist/functions/src/information/iserror.d.ts +9 -0
- package/dist/functions/src/information/iserror.d.ts.map +1 -0
- package/dist/functions/src/information/iserror.spec.d.ts +2 -0
- package/dist/functions/src/information/iserror.spec.d.ts.map +1 -0
- package/dist/functions/src/information/isformula.d.ts +9 -0
- package/dist/functions/src/information/isformula.d.ts.map +1 -0
- package/dist/functions/src/information/isformula.spec.d.ts +2 -0
- package/dist/functions/src/information/isformula.spec.d.ts.map +1 -0
- package/dist/functions/src/information/islogical.d.ts +9 -0
- package/dist/functions/src/information/islogical.d.ts.map +1 -0
- package/dist/functions/src/information/islogical.spec.d.ts +2 -0
- package/dist/functions/src/information/islogical.spec.d.ts.map +1 -0
- package/dist/functions/src/information/isna.d.ts +9 -0
- package/dist/functions/src/information/isna.d.ts.map +1 -0
- package/dist/functions/src/information/isna.spec.d.ts +2 -0
- package/dist/functions/src/information/isna.spec.d.ts.map +1 -0
- package/dist/functions/src/information/isnontext.d.ts +9 -0
- package/dist/functions/src/information/isnontext.d.ts.map +1 -0
- package/dist/functions/src/information/isnontext.spec.d.ts +2 -0
- package/dist/functions/src/information/isnontext.spec.d.ts.map +1 -0
- package/dist/functions/src/information/isref.d.ts +9 -0
- package/dist/functions/src/information/isref.d.ts.map +1 -0
- package/dist/functions/src/information/isref.spec.d.ts +2 -0
- package/dist/functions/src/information/isref.spec.d.ts.map +1 -0
- package/dist/functions/src/information/istext.d.ts +9 -0
- package/dist/functions/src/information/istext.d.ts.map +1 -0
- package/dist/functions/src/information/istext.spec.d.ts +2 -0
- package/dist/functions/src/information/istext.spec.d.ts.map +1 -0
- package/dist/functions/src/information/n.d.ts +9 -0
- package/dist/functions/src/information/n.d.ts.map +1 -0
- package/dist/functions/src/information/n.spec.d.ts +2 -0
- package/dist/functions/src/information/n.spec.d.ts.map +1 -0
- package/dist/functions/src/information/na.d.ts +9 -0
- package/dist/functions/src/information/na.d.ts.map +1 -0
- package/dist/functions/src/information/na.spec.d.ts +2 -0
- package/dist/functions/src/information/na.spec.d.ts.map +1 -0
- package/dist/functions/src/information/sheets.d.ts +9 -0
- package/dist/functions/src/information/sheets.d.ts.map +1 -0
- package/dist/functions/src/information/sheets.spec.d.ts +2 -0
- package/dist/functions/src/information/sheets.spec.d.ts.map +1 -0
- package/dist/functions/src/logical/ifna.d.ts +10 -0
- package/dist/functions/src/logical/ifna.d.ts.map +1 -0
- package/dist/functions/src/logical/ifs.d.ts +10 -0
- package/dist/functions/src/logical/ifs.d.ts.map +1 -0
- package/dist/functions/src/logical/index.d.ts +4 -0
- package/dist/functions/src/logical/index.d.ts.map +1 -0
- package/dist/functions/src/logical/xor.d.ts +9 -0
- package/dist/functions/src/logical/xor.d.ts.map +1 -0
- package/dist/functions/src/lookup/column.d.ts +12 -0
- package/dist/functions/src/lookup/column.d.ts.map +1 -0
- package/dist/functions/src/lookup/column.spec.d.ts +2 -0
- package/dist/functions/src/lookup/column.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/columns.d.ts +9 -0
- package/dist/functions/src/lookup/columns.d.ts.map +1 -0
- package/dist/functions/src/lookup/columns.spec.d.ts +2 -0
- package/dist/functions/src/lookup/columns.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/hlookup.d.ts +9 -0
- package/dist/functions/src/lookup/hlookup.d.ts.map +1 -0
- package/dist/functions/src/lookup/hlookup.spec.d.ts +2 -0
- package/dist/functions/src/lookup/hlookup.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/index.d.ts +4 -0
- package/dist/functions/src/lookup/index.d.ts.map +1 -0
- package/dist/functions/src/lookup/indexFn.d.ts +10 -0
- package/dist/functions/src/lookup/indexFn.d.ts.map +1 -0
- package/dist/functions/src/lookup/indexFn.spec.d.ts +2 -0
- package/dist/functions/src/lookup/indexFn.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/match.d.ts +10 -0
- package/dist/functions/src/lookup/match.d.ts.map +1 -0
- package/dist/functions/src/lookup/match.spec.d.ts +2 -0
- package/dist/functions/src/lookup/match.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/row.d.ts +12 -0
- package/dist/functions/src/lookup/row.d.ts.map +1 -0
- package/dist/functions/src/lookup/row.spec.d.ts +2 -0
- package/dist/functions/src/lookup/row.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/rows.d.ts +9 -0
- package/dist/functions/src/lookup/rows.d.ts.map +1 -0
- package/dist/functions/src/lookup/rows.spec.d.ts +2 -0
- package/dist/functions/src/lookup/rows.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/sheet.d.ts +9 -0
- package/dist/functions/src/lookup/sheet.d.ts.map +1 -0
- package/dist/functions/src/lookup/sheet.spec.d.ts +2 -0
- package/dist/functions/src/lookup/sheet.spec.d.ts.map +1 -0
- package/dist/functions/src/lookup/vlookup.d.ts +9 -0
- package/dist/functions/src/lookup/vlookup.d.ts.map +1 -0
- package/dist/functions/src/lookup/vlookup.spec.d.ts +2 -0
- package/dist/functions/src/lookup/vlookup.spec.d.ts.map +1 -0
- package/dist/functions/src/math/__matrix_base.d.ts +15 -0
- package/dist/functions/src/math/__matrix_base.d.ts.map +1 -0
- package/dist/functions/src/math/acos.d.ts +9 -0
- package/dist/functions/src/math/acos.d.ts.map +1 -0
- package/dist/functions/src/math/acos.spec.d.ts +2 -0
- package/dist/functions/src/math/acos.spec.d.ts.map +1 -0
- package/dist/functions/src/math/asin.d.ts +9 -0
- package/dist/functions/src/math/asin.d.ts.map +1 -0
- package/dist/functions/src/math/asin.spec.d.ts +2 -0
- package/dist/functions/src/math/asin.spec.d.ts.map +1 -0
- package/dist/functions/src/math/atan.d.ts +9 -0
- package/dist/functions/src/math/atan.d.ts.map +1 -0
- package/dist/functions/src/math/atan.spec.d.ts +2 -0
- package/dist/functions/src/math/atan.spec.d.ts.map +1 -0
- package/dist/functions/src/math/atan2.d.ts +9 -0
- package/dist/functions/src/math/atan2.d.ts.map +1 -0
- package/dist/functions/src/math/atan2.spec.d.ts +2 -0
- package/dist/functions/src/math/atan2.spec.d.ts.map +1 -0
- package/dist/functions/src/math/base.d.ts +10 -0
- package/dist/functions/src/math/base.d.ts.map +1 -0
- package/dist/functions/src/math/base.spec.d.ts +2 -0
- package/dist/functions/src/math/base.spec.d.ts.map +1 -0
- package/dist/functions/src/math/cos.d.ts +9 -0
- package/dist/functions/src/math/cos.d.ts.map +1 -0
- package/dist/functions/src/math/cos.spec.d.ts +2 -0
- package/dist/functions/src/math/cos.spec.d.ts.map +1 -0
- package/dist/functions/src/math/countif.d.ts +9 -0
- package/dist/functions/src/math/countif.d.ts.map +1 -0
- package/dist/functions/src/math/countif.spec.d.ts +2 -0
- package/dist/functions/src/math/countif.spec.d.ts.map +1 -0
- package/dist/functions/src/math/countifs.d.ts +10 -0
- package/dist/functions/src/math/countifs.d.ts.map +1 -0
- package/dist/functions/src/math/countifs.spec.d.ts +2 -0
- package/dist/functions/src/math/countifs.spec.d.ts.map +1 -0
- package/dist/functions/src/math/even.d.ts +9 -0
- package/dist/functions/src/math/even.d.ts.map +1 -0
- package/dist/functions/src/math/even.spec.d.ts +2 -0
- package/dist/functions/src/math/even.spec.d.ts.map +1 -0
- package/dist/functions/src/math/exp.d.ts +10 -0
- package/dist/functions/src/math/exp.d.ts.map +1 -0
- package/dist/functions/src/math/exp.spec.d.ts +2 -0
- package/dist/functions/src/math/exp.spec.d.ts.map +1 -0
- package/dist/functions/src/math/fact.d.ts +9 -0
- package/dist/functions/src/math/fact.d.ts.map +1 -0
- package/dist/functions/src/math/fact.spec.d.ts +2 -0
- package/dist/functions/src/math/fact.spec.d.ts.map +1 -0
- package/dist/functions/src/math/index.d.ts +4 -0
- package/dist/functions/src/math/index.d.ts.map +1 -0
- package/dist/functions/src/math/int.d.ts +9 -0
- package/dist/functions/src/math/int.d.ts.map +1 -0
- package/dist/functions/src/math/int.spec.d.ts +2 -0
- package/dist/functions/src/math/int.spec.d.ts.map +1 -0
- package/dist/functions/src/math/iseven.d.ts +9 -0
- package/dist/functions/src/math/iseven.d.ts.map +1 -0
- package/dist/functions/src/math/iseven.spec.d.ts +2 -0
- package/dist/functions/src/math/iseven.spec.d.ts.map +1 -0
- package/dist/functions/src/math/isodd.d.ts +9 -0
- package/dist/functions/src/math/isodd.d.ts.map +1 -0
- package/dist/functions/src/math/isodd.spec.d.ts +2 -0
- package/dist/functions/src/math/isodd.spec.d.ts.map +1 -0
- package/dist/functions/src/math/lcm.d.ts +10 -0
- package/dist/functions/src/math/lcm.d.ts.map +1 -0
- package/dist/functions/src/math/lcm.spec.d.ts +2 -0
- package/dist/functions/src/math/lcm.spec.d.ts.map +1 -0
- package/dist/functions/src/math/ln.d.ts +9 -0
- package/dist/functions/src/math/ln.d.ts.map +1 -0
- package/dist/functions/src/math/ln.spec.d.ts +2 -0
- package/dist/functions/src/math/ln.spec.d.ts.map +1 -0
- package/dist/functions/src/math/log.d.ts +10 -0
- package/dist/functions/src/math/log.d.ts.map +1 -0
- package/dist/functions/src/math/log.spec.d.ts +2 -0
- package/dist/functions/src/math/log.spec.d.ts.map +1 -0
- package/dist/functions/src/math/log10.d.ts +9 -0
- package/dist/functions/src/math/log10.d.ts.map +1 -0
- package/dist/functions/src/math/log10.spec.d.ts +2 -0
- package/dist/functions/src/math/log10.spec.d.ts.map +1 -0
- package/dist/functions/src/math/mdeterm.d.ts +11 -0
- package/dist/functions/src/math/mdeterm.d.ts.map +1 -0
- package/dist/functions/src/math/minverse.d.ts +12 -0
- package/dist/functions/src/math/minverse.d.ts.map +1 -0
- package/dist/functions/src/math/mmult.d.ts +11 -0
- package/dist/functions/src/math/mmult.d.ts.map +1 -0
- package/dist/functions/src/math/mod.d.ts +10 -0
- package/dist/functions/src/math/mod.d.ts.map +1 -0
- package/dist/functions/src/math/mod.spec.d.ts +2 -0
- package/dist/functions/src/math/mod.spec.d.ts.map +1 -0
- package/dist/functions/src/math/odd.d.ts +9 -0
- package/dist/functions/src/math/odd.d.ts.map +1 -0
- package/dist/functions/src/math/odd.spec.d.ts +2 -0
- package/dist/functions/src/math/odd.spec.d.ts.map +1 -0
- package/dist/functions/src/math/pi.d.ts +9 -0
- package/dist/functions/src/math/pi.d.ts.map +1 -0
- package/dist/functions/src/math/pi.spec.d.ts +2 -0
- package/dist/functions/src/math/pi.spec.d.ts.map +1 -0
- package/dist/functions/src/math/product.d.ts +9 -0
- package/dist/functions/src/math/product.d.ts.map +1 -0
- package/dist/functions/src/math/product.spec.d.ts +2 -0
- package/dist/functions/src/math/product.spec.d.ts.map +1 -0
- package/dist/functions/src/math/radians.d.ts +9 -0
- package/dist/functions/src/math/radians.d.ts.map +1 -0
- package/dist/functions/src/math/radians.spec.d.ts +2 -0
- package/dist/functions/src/math/radians.spec.d.ts.map +1 -0
- package/dist/functions/src/math/rand.d.ts +9 -0
- package/dist/functions/src/math/rand.d.ts.map +1 -0
- package/dist/functions/src/math/rand.spec.d.ts +2 -0
- package/dist/functions/src/math/rand.spec.d.ts.map +1 -0
- package/dist/functions/src/math/round.d.ts +9 -0
- package/dist/functions/src/math/round.d.ts.map +1 -0
- package/dist/functions/src/math/round.spec.d.ts +2 -0
- package/dist/functions/src/math/round.spec.d.ts.map +1 -0
- package/dist/functions/src/math/rounddown.d.ts +9 -0
- package/dist/functions/src/math/rounddown.d.ts.map +1 -0
- package/dist/functions/src/math/rounddown.spec.d.ts +2 -0
- package/dist/functions/src/math/rounddown.spec.d.ts.map +1 -0
- package/dist/functions/src/math/roundup.d.ts +9 -0
- package/dist/functions/src/math/roundup.d.ts.map +1 -0
- package/dist/functions/src/math/roundup.spec.d.ts +2 -0
- package/dist/functions/src/math/roundup.spec.d.ts.map +1 -0
- package/dist/functions/src/math/sequence.d.ts +11 -0
- package/dist/functions/src/math/sequence.d.ts.map +1 -0
- package/dist/functions/src/math/sequence.spec.d.ts +2 -0
- package/dist/functions/src/math/sequence.spec.d.ts.map +1 -0
- package/dist/functions/src/math/sign.d.ts +9 -0
- package/dist/functions/src/math/sign.d.ts.map +1 -0
- package/dist/functions/src/math/sign.spec.d.ts +2 -0
- package/dist/functions/src/math/sign.spec.d.ts.map +1 -0
- package/dist/functions/src/math/sin.d.ts +9 -0
- package/dist/functions/src/math/sin.d.ts.map +1 -0
- package/dist/functions/src/math/sin.spec.d.ts +2 -0
- package/dist/functions/src/math/sin.spec.d.ts.map +1 -0
- package/dist/functions/src/math/sqrt.d.ts +9 -0
- package/dist/functions/src/math/sqrt.d.ts.map +1 -0
- package/dist/functions/src/math/sqrt.spec.d.ts +2 -0
- package/dist/functions/src/math/sqrt.spec.d.ts.map +1 -0
- package/dist/functions/src/math/sumif.d.ts +9 -0
- package/dist/functions/src/math/sumif.d.ts.map +1 -0
- package/dist/functions/src/math/sumifs.d.ts +10 -0
- package/dist/functions/src/math/sumifs.d.ts.map +1 -0
- package/dist/functions/src/math/sumifs.spec.d.ts +2 -0
- package/dist/functions/src/math/sumifs.spec.d.ts.map +1 -0
- package/dist/functions/src/math/sumproduct.d.ts +10 -0
- package/dist/functions/src/math/sumproduct.d.ts.map +1 -0
- package/dist/functions/src/math/sumsq.d.ts +9 -0
- package/dist/functions/src/math/sumsq.d.ts.map +1 -0
- package/dist/functions/src/math/sumsq.spec.d.ts +2 -0
- package/dist/functions/src/math/sumsq.spec.d.ts.map +1 -0
- package/dist/functions/src/math/tan.d.ts +9 -0
- package/dist/functions/src/math/tan.d.ts.map +1 -0
- package/dist/functions/src/math/tan.spec.d.ts +2 -0
- package/dist/functions/src/math/tan.spec.d.ts.map +1 -0
- package/dist/functions/src/math/transpose.d.ts +11 -0
- package/dist/functions/src/math/transpose.d.ts.map +1 -0
- package/dist/functions/src/math/trunc.d.ts +9 -0
- package/dist/functions/src/math/trunc.d.ts.map +1 -0
- package/dist/functions/src/math/trunc.spec.d.ts +2 -0
- package/dist/functions/src/math/trunc.spec.d.ts.map +1 -0
- package/dist/functions/src/math/unaryPercent.d.ts +9 -0
- package/dist/functions/src/math/unaryPercent.d.ts.map +1 -0
- package/dist/functions/src/math/unaryPercent.spec.d.ts +2 -0
- package/dist/functions/src/math/unaryPercent.spec.d.ts.map +1 -0
- package/dist/functions/src/math/uplus.d.ts +9 -0
- package/dist/functions/src/math/uplus.d.ts.map +1 -0
- package/dist/functions/src/math/uplus.spec.d.ts +2 -0
- package/dist/functions/src/math/uplus.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/averageif.d.ts +9 -0
- package/dist/functions/src/statistics/averageif.d.ts.map +1 -0
- package/dist/functions/src/statistics/averageifs.d.ts +10 -0
- package/dist/functions/src/statistics/averageifs.d.ts.map +1 -0
- package/dist/functions/src/statistics/averageifs.spec.d.ts +2 -0
- package/dist/functions/src/statistics/averageifs.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/correl.d.ts +10 -0
- package/dist/functions/src/statistics/correl.d.ts.map +1 -0
- package/dist/functions/src/statistics/correl.spec.d.ts +2 -0
- package/dist/functions/src/statistics/correl.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/covariance_p.d.ts +10 -0
- package/dist/functions/src/statistics/covariance_p.d.ts.map +1 -0
- package/dist/functions/src/statistics/covariance_p.spec.d.ts +2 -0
- package/dist/functions/src/statistics/covariance_p.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/covariance_s.d.ts +10 -0
- package/dist/functions/src/statistics/covariance_s.d.ts.map +1 -0
- package/dist/functions/src/statistics/covariance_s.spec.d.ts +2 -0
- package/dist/functions/src/statistics/covariance_s.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/index.d.ts +4 -0
- package/dist/functions/src/statistics/index.d.ts.map +1 -0
- package/dist/functions/src/statistics/median.d.ts +10 -0
- package/dist/functions/src/statistics/median.d.ts.map +1 -0
- package/dist/functions/src/statistics/median.spec.d.ts +2 -0
- package/dist/functions/src/statistics/median.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/mode_sngl.d.ts +10 -0
- package/dist/functions/src/statistics/mode_sngl.d.ts.map +1 -0
- package/dist/functions/src/statistics/mode_sngl.spec.d.ts +2 -0
- package/dist/functions/src/statistics/mode_sngl.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/percentile_inc.d.ts +10 -0
- package/dist/functions/src/statistics/percentile_inc.d.ts.map +1 -0
- package/dist/functions/src/statistics/percentile_inc.spec.d.ts +2 -0
- package/dist/functions/src/statistics/percentile_inc.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/quartile_inc.d.ts +10 -0
- package/dist/functions/src/statistics/quartile_inc.d.ts.map +1 -0
- package/dist/functions/src/statistics/quartile_inc.spec.d.ts +2 -0
- package/dist/functions/src/statistics/quartile_inc.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/rank_eq.d.ts +10 -0
- package/dist/functions/src/statistics/rank_eq.d.ts.map +1 -0
- package/dist/functions/src/statistics/rank_eq.spec.d.ts +2 -0
- package/dist/functions/src/statistics/rank_eq.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/rsq.d.ts +10 -0
- package/dist/functions/src/statistics/rsq.d.ts.map +1 -0
- package/dist/functions/src/statistics/rsq.spec.d.ts +2 -0
- package/dist/functions/src/statistics/rsq.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/stdev_p.d.ts +10 -0
- package/dist/functions/src/statistics/stdev_p.d.ts.map +1 -0
- package/dist/functions/src/statistics/stdev_p.spec.d.ts +2 -0
- package/dist/functions/src/statistics/stdev_p.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/stdev_s.d.ts +10 -0
- package/dist/functions/src/statistics/stdev_s.d.ts.map +1 -0
- package/dist/functions/src/statistics/stdev_s.spec.d.ts +2 -0
- package/dist/functions/src/statistics/stdev_s.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/t_test.d.ts +10 -0
- package/dist/functions/src/statistics/t_test.d.ts.map +1 -0
- package/dist/functions/src/statistics/t_test.spec.d.ts +2 -0
- package/dist/functions/src/statistics/t_test.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/var_p.d.ts +10 -0
- package/dist/functions/src/statistics/var_p.d.ts.map +1 -0
- package/dist/functions/src/statistics/var_p.spec.d.ts +2 -0
- package/dist/functions/src/statistics/var_p.spec.d.ts.map +1 -0
- package/dist/functions/src/statistics/var_s.d.ts +10 -0
- package/dist/functions/src/statistics/var_s.d.ts.map +1 -0
- package/dist/functions/src/statistics/var_s.spec.d.ts +2 -0
- package/dist/functions/src/statistics/var_s.spec.d.ts.map +1 -0
- package/dist/functions/src/text/char.d.ts +9 -0
- package/dist/functions/src/text/char.d.ts.map +1 -0
- package/dist/functions/src/text/char.spec.d.ts +2 -0
- package/dist/functions/src/text/char.spec.d.ts.map +1 -0
- package/dist/functions/src/text/clean.d.ts +9 -0
- package/dist/functions/src/text/clean.d.ts.map +1 -0
- package/dist/functions/src/text/clean.spec.d.ts +2 -0
- package/dist/functions/src/text/clean.spec.d.ts.map +1 -0
- package/dist/functions/src/text/concatenate.d.ts +9 -0
- package/dist/functions/src/text/concatenate.d.ts.map +1 -0
- package/dist/functions/src/text/concatenate.spec.d.ts +2 -0
- package/dist/functions/src/text/concatenate.spec.d.ts.map +1 -0
- package/dist/functions/src/text/exact.d.ts +9 -0
- package/dist/functions/src/text/exact.d.ts.map +1 -0
- package/dist/functions/src/text/exact.spec.d.ts +2 -0
- package/dist/functions/src/text/exact.spec.d.ts.map +1 -0
- package/dist/functions/src/text/index.d.ts +4 -0
- package/dist/functions/src/text/index.d.ts.map +1 -0
- package/dist/functions/src/text/join.d.ts +10 -0
- package/dist/functions/src/text/join.d.ts.map +1 -0
- package/dist/functions/src/text/join.spec.d.ts +2 -0
- package/dist/functions/src/text/join.spec.d.ts.map +1 -0
- package/dist/functions/src/text/lenb.d.ts +9 -0
- package/dist/functions/src/text/lenb.d.ts.map +1 -0
- package/dist/functions/src/text/lenb.spec.d.ts +2 -0
- package/dist/functions/src/text/lenb.spec.d.ts.map +1 -0
- package/dist/functions/src/text/lower.d.ts +9 -0
- package/dist/functions/src/text/lower.d.ts.map +1 -0
- package/dist/functions/src/text/lower.spec.d.ts +2 -0
- package/dist/functions/src/text/lower.spec.d.ts.map +1 -0
- package/dist/functions/src/text/proper.d.ts +9 -0
- package/dist/functions/src/text/proper.d.ts.map +1 -0
- package/dist/functions/src/text/proper.spec.d.ts +2 -0
- package/dist/functions/src/text/proper.spec.d.ts.map +1 -0
- package/dist/functions/src/text/replace.d.ts +10 -0
- package/dist/functions/src/text/replace.d.ts.map +1 -0
- package/dist/functions/src/text/replace.spec.d.ts +2 -0
- package/dist/functions/src/text/replace.spec.d.ts.map +1 -0
- package/dist/functions/src/text/rept.d.ts +10 -0
- package/dist/functions/src/text/rept.d.ts.map +1 -0
- package/dist/functions/src/text/rept.spec.d.ts +2 -0
- package/dist/functions/src/text/rept.spec.d.ts.map +1 -0
- package/dist/functions/src/text/trim.d.ts +9 -0
- package/dist/functions/src/text/trim.d.ts.map +1 -0
- package/dist/functions/src/text/trim.spec.d.ts +2 -0
- package/dist/functions/src/text/trim.spec.d.ts.map +1 -0
- package/dist/functions/src/text/unichar.d.ts +9 -0
- package/dist/functions/src/text/unichar.d.ts.map +1 -0
- package/dist/functions/src/text/unichar.spec.d.ts +2 -0
- package/dist/functions/src/text/unichar.spec.d.ts.map +1 -0
- package/dist/functions/src/text/unicode.d.ts +9 -0
- package/dist/functions/src/text/unicode.d.ts.map +1 -0
- package/dist/functions/src/text/unicode.spec.d.ts +2 -0
- package/dist/functions/src/text/unicode.spec.d.ts.map +1 -0
- package/dist/functions/src/text/upper.d.ts +9 -0
- package/dist/functions/src/text/upper.d.ts.map +1 -0
- package/dist/functions/src/text/upper.spec.d.ts +2 -0
- package/dist/functions/src/text/upper.spec.d.ts.map +1 -0
- package/dist/functions/src/time/date.d.ts +9 -0
- package/dist/functions/src/time/date.d.ts.map +1 -0
- package/dist/functions/src/time/day.d.ts +9 -0
- package/dist/functions/src/time/day.d.ts.map +1 -0
- package/dist/functions/src/time/days.d.ts +9 -0
- package/dist/functions/src/time/days.d.ts.map +1 -0
- package/dist/functions/src/time/hour.d.ts +9 -0
- package/dist/functions/src/time/hour.d.ts.map +1 -0
- package/dist/functions/src/time/index.d.ts +4 -0
- package/dist/functions/src/time/index.d.ts.map +1 -0
- package/dist/functions/src/time/minute.d.ts +9 -0
- package/dist/functions/src/time/minute.d.ts.map +1 -0
- package/dist/functions/src/time/month.d.ts +9 -0
- package/dist/functions/src/time/month.d.ts.map +1 -0
- package/dist/functions/src/time/second.d.ts +9 -0
- package/dist/functions/src/time/second.d.ts.map +1 -0
- package/dist/functions/src/time/time.d.ts +9 -0
- package/dist/functions/src/time/time.d.ts.map +1 -0
- package/dist/functions/src/time/today.d.ts +9 -0
- package/dist/functions/src/time/today.d.ts.map +1 -0
- package/dist/functions/src/time/workday.d.ts +9 -0
- package/dist/functions/src/time/workday.d.ts.map +1 -0
- package/dist/functions/src/time/year.d.ts +9 -0
- package/dist/functions/src/time/year.d.ts.map +1 -0
- package/dist/functions/src/types.d.ts +2 -0
- package/dist/functions/src/types.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +321 -0
- package/dist/index.js.map +1 -0
- package/dist/lookup/index.d.ts +6 -0
- package/dist/lookup/index.js +360 -0
- package/dist/lookup/index.js.map +1 -0
- package/dist/math/index.d.ts +6 -0
- package/dist/math/index.js +1021 -0
- package/dist/math/index.js.map +1 -0
- package/dist/statistics/index.d.ts +6 -0
- package/dist/statistics/index.js +706 -0
- package/dist/statistics/index.js.map +1 -0
- package/dist/text/index.d.ts +6 -0
- package/dist/text/index.js +258 -0
- package/dist/text/index.js.map +1 -0
- package/dist/time/index.d.ts +6 -0
- package/dist/time/index.js +194 -0
- package/dist/time/index.js.map +1 -0
- 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
|