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

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from

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  18 passed
flaky  1 flaky

Details

stats  19 tests across 9 suites
duration  5 minutes, 6 seconds
commit  e959f54
info  For more information, see full report

Flaky tests

chromium › memory/memory.spec.ts › memory

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 97.86880% with 64 lines in your changes missing coverage. Please review.

Project coverage is 32.47%. Comparing base (7f1cf91) to head (e959f54).

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 96.24% 5 Missing ⚠️
...src/functions/statistical/percentrank-exc/index.ts 96.10% 3 Missing ⚠️
...src/functions/statistical/percentrank-inc/index.ts 96.10% 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 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3684      +/-   ##
==========================================
+ Coverage   30.93%   32.47%   +1.53%     
==========================================
  Files        2387     2437      +50     
  Lines      122020   124873    +2853     
  Branches    26999    27860     +861     
==========================================
+ Hits        37750    40549    +2799     
- Misses      84270    84324      +54     

☔ 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

@univer-bot
Copy link

univer-bot bot commented Oct 30, 2024

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

  1. Enter =T.INV/T.INV.2T/TINV(0,1) in the cell, and the error codes are inconsistent.
    image

  2. Enter T.INV.2T/TINV(A1,B1) in the cell. A1 is empty, B1=1, and the error codes are inconsistent.
    image

@oumomomo
Copy link

oumomomo commented Oct 30, 2024

TTEST/T.TEST函数

1、单元格内输入=TTEST/T.TEST(A1:A9,B1:B9,2,1),计算结果错误
样张:https://1drv.ms/x/c/c874bd32de218f8c/EX2JTidx4MJAvOa6MHVzQ6gBIiXJD5zkuflp7shZ8niTxQ?e=dXtJtQ
image

2、单元格内输入=TTEST/T.TEST(A2:B3,C2,2,2),错误码不一致
image

@univer-bot
Copy link

univer-bot bot commented Oct 30, 2024

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

TTEST/T.TEST function

  1. Enter =TTEST/T.TEST(A1:A9,B1:B9,2,1) in the cell, and the calculation result is wrong.
    Sample: https://1drv.ms/x/c/c874bd32de218f8c/EX2JTidx4MJAvOa6MHVzQ6gBIiXJD5zkuflp7shZ8niTxQ?e=dXtJtQ
    image

  2. Enter =TTEST/T.TEST(A2:B3,C2,2,2) in the cell, but the error codes are inconsistent.
    image

@oumomomo
Copy link

oumomomo commented Oct 30, 2024

WEIBULL.DIST函数
1、单元格内输入=WEIBULL.DIST(A2:A3,A1:B3,A1:B4,TRUE)/=WEIBULL.DIST(10,22,56,TRUE),计算结果不对
image
image

2、单元格内输入=WEIBULL.DIST(27.29004,41,99999999999,FALSE),计算结果未报错
image

@univer-bot
Copy link

univer-bot bot commented Oct 30, 2024

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

WEIBULL.DIST function

  1. Enter =WEIBULL.DIST(A2:A3,A1:B3,A1:B4,TRUE)/=WEIBULL.DIST(10,22,56,TRUE) in the cell, and the calculation result is incorrect.
    image
    image

  2. Enter =WEIBULL.DIST(27.29004,41,99999999999,FALSE) in the cell, and no error will be reported in the calculation result.
    image

@univer-bot univer-bot bot removed the qa:untested This PR is ready to be tested label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants