Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(formula): add some statistical formulas #3684

Merged
merged 24 commits into from
Oct 31, 2024

Conversation

wpxp123456
Copy link
Contributor

@wpxp123456 wpxp123456 commented Oct 10, 2024

close https://github.com/dream-num/univer-pro/issues/2633
close https://github.com/dream-num/univer-pro/issues/2841
close https://github.com/dream-num/univer-pro/issues/2949

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

@wpxp123456 wpxp123456 added the qa:untested This PR is ready to be tested label Oct 10, 2024
Copy link

github-actions bot commented Oct 10, 2024

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

Copy link

github-actions bot commented Oct 10, 2024

Playwright test results

passed  19 passed

Details

stats  19 tests across 9 suites
duration  4 minutes, 37 seconds
commit  4cedd66
info  For more information, see full report

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 97.72952% with 69 lines in your changes missing coverage. Please review.

Project coverage is 32.31%. Comparing base (56eeb04) to head (4cedd66).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
packages/engine-formula/src/basics/math.ts 95.34% 10 Missing ⚠️
packages/engine-formula/src/basics/statistical.ts 93.82% 10 Missing ⚠️
...ngine-formula/src/engine/ast-node/function-node.ts 0.00% 9 Missing ⚠️
...-formula/src/functions/statistical/growth/index.ts 95.10% 9 Missing ⚠️
...-formula/src/functions/statistical/t-test/index.ts 95.75% 7 Missing ⚠️
...src/functions/statistical/percentrank-exc/index.ts 96.00% 3 Missing ⚠️
...src/functions/statistical/percentrank-inc/index.ts 96.00% 3 Missing ⚠️
...-formula/src/functions/statistical/z-test/index.ts 97.26% 2 Missing ⚠️
...ages/engine-formula/src/functions/base-function.ts 0.00% 1 Missing ⚠️
...formula/src/functions/compatibility/tdist/index.ts 97.67% 1 Missing ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3684      +/-   ##
==========================================
+ Coverage   30.77%   32.31%   +1.54%     
==========================================
  Files        2406     2456      +50     
  Lines      122969   125858    +2889     
  Branches    27227    28104     +877     
==========================================
+ Hits        37842    40672    +2830     
- Misses      85127    85186      +59     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wpxp123456 wpxp123456 force-pushed the feat/add-statistical-function branch 3 times, most recently from d2b24d5 to 863ccb1 Compare October 15, 2024 06:42
@oumomomo
Copy link

oumomomo commented Oct 18, 2024

GAMMA函数

1、单元格内输入=GAMMA(174),计算结果未报错
image

2、单元格内输入=GAMMA(B14),B14=1月2日 计算结果未报错
image

@univer-bot
Copy link

univer-bot bot commented Oct 18, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

GAMMA function

  1. Enter =GAMMA(174) in the cell, and no error will be reported in the calculation result.
    image

  2. Enter =GAMMA(B14) in the cell, B14=January 2. The calculation result does not report an error.
    image

@oumomomo
Copy link

GAMMA.INV函数

单元格内输入=GAMMA.INV(0.1,10000000,1000),计算结果不一致
image

@univer-bot
Copy link

univer-bot bot commented Oct 18, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

GAMMA.INV function

Enter =GAMMA.INV(0.1,10000000,1000) in the cell, but the calculation results are inconsistent.
image

@oumomomo
Copy link

oumomomo commented Oct 18, 2024

GAMMALN函数

单元格内输入=GAMMALN/GAMMALN.PRECISE(2),计算结果不对
image

@univer-bot
Copy link

univer-bot bot commented Oct 18, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

GAMMALN function

Enter =GAMMALN/GAMMALN.PRECISE(2) into the cell, and the calculation result is incorrect.
image

@wpxp123456 wpxp123456 force-pushed the feat/add-statistical-function branch 5 times, most recently from 4caf0e6 to fb94503 Compare October 23, 2024 03:11
@oumomomo
Copy link

HARMEAN函数

=HARMEAN(空单元格),错误码不一致
image

@univer-bot
Copy link

univer-bot bot commented Oct 23, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

HARMEAN function

=HARMEAN (empty cell), error codes are inconsistent
image

@oumomomo
Copy link

oumomomo commented Oct 23, 2024

HYPGEOM.DIST/HYPGEOMDIST 函数

1、单元格内输入=HYPGEOM.DIST(A17,A18,A19,A20,TRUE),A17单元格有值,A18-A20单元格为空,计算不出结果
image

2、单元格内输入=HYPGEOM.DIST(A2:A5,A3:A5,A4,A5,TRUE),第三个单元格计算结果不对
样张:https://1drv.ms/x/c/c874bd32de218f8c/EUOanzZIOgVKmnSORktw2cQBrLrODEn5uOVnV5W8ZZRdgg?e=KlovN4
image

3、单元格内输入=HYPGEOM.DIST(0,20,20,20,TRUE)/=HYPGEOM.DIST(0.1,20,4,20,TRUE),计算不出结果
image

4、单元格内输入=HYPGEOM.DIST(20,20,20,20,TRUE),计算结果不对
image

@univer-bot
Copy link

univer-bot bot commented Oct 23, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

HYPGEOM.DIST/HYPGEOMDIST function

  1. Enter =HYPGEOM.DIST(A17,A18,A19,A20,TRUE) in the cell. Cell A17 has a value, but cells A18-A20 are empty, and the result cannot be calculated.
    image

  2. Enter =HYPGEOM.DIST(A2:A5,A3:A5,A4,A5,TRUE) in the cell, and the calculation result of the third cell is incorrect.
    Sample: https://1drv.ms/x/c/c874bd32de218f8c/EUOanzZIOgVKmnSORktw2cQBrLrODEn5uOVnV5W8ZZRdgg?e=KlovN4
    image

  3. Enter =HYPGEOM.DIST(0,20,20,20,TRUE)/=HYPGEOM.DIST(0.1,20,4,20,TRUE) in the cell, but the result cannot be calculated.
    image

  4. Enter =HYPGEOM.DIST(20,20,20,20,TRUE) in the cell, and the calculation result is incorrect.
    image

@zhaolixin7
Copy link

large
参数为数字文本时未报错,Google和Excel 报#num
image
image

@univer-bot
Copy link

univer-bot bot commented Oct 23, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

large
No error is reported when the parameter is numeric text, Google and Excel report #num
image
image

@zhaolixin7
Copy link

zhaolixin7 commented Oct 23, 2024

z.test
1、参数错误时Excel报#value Google报#error("=Z.TEST("2,2,2,",95,1.98)")
image
image
2、数字文本时Excel报错#n/a
image
image
3、第2个参数为空时结果等于0和Excel的不一样
image
image

ztest
表数据:
2024_10_25 17_04_03 snapshot.json
1、参数为-1、0.1时计算不出结果,参数为文字时预期包#value
image
2、选中引用区域填充后 false计算不出结果
2024_10_25 16_54_35 video.webm
image
3、引用选区一样时报错和Excel不一样
image

@univer-bot
Copy link

univer-bot bot commented Oct 23, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

z.test

  1. When the parameter is wrong, Excel will report #value and Google will report #error ("=Z.TEST("2,2,2,",95,1.98)")
    image
    image
  2. Excel reports error #n/a when using digital text.
    image
    image
  3. When the second parameter is empty, the result is equal to 0, which is different from Excel.
    image
    image

ztest
Table data:
2024_10_25 17_04_03 snapshot.json

  1. No result can be calculated when the parameter is -1 or 0.1. When the parameter is text, #value is expected.
    image
  2. After selecting the reference area and filling it, if false, the result cannot be calculated.
    2024_10_25 16_54_35 video.webm
    image
  3. When referencing a selection, the error reported is different from that in Excel.
    image

@oumomomo
Copy link

LOGNORMDIST函数

单元格=LOGNORMDIST(0.2,3,0.2),计算结果错误
image

@univer-bot
Copy link

univer-bot bot commented Oct 23, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

LOGNORMDIST function

Cell =LOGNORMDIST(0.2,3,0.2), the calculation result is wrong
image

@oumomomo oumomomo added qa:verified This PR has already by verified by a QA and is considered good enough to be merge and removed qa:rejected labels Oct 31, 2024
@wpxp123456 wpxp123456 merged commit 51f1616 into dev Oct 31, 2024
9 checks passed
@wpxp123456 wpxp123456 deleted the feat/add-statistical-function branch October 31, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa:verified This PR has already by verified by a QA and is considered good enough to be merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants