dream-num / univer

Univer is an open-source productivity tool dev kit helping you integrate spreadsheets, docs and slides into your applications.
https://univer.ai
Apache License 2.0
6.8k stars 588 forks source link

feat(formula): add some statistical formulas #3463

Closed wpxp123456 closed 2 weeks ago

wpxp123456 commented 3 weeks ago

close https://github.com/dream-num/univer-pro/issues/2443

Pull Request Checklist

github-actions[bot] commented 3 weeks ago

View Deployment

๐Ÿ“‘ Examples ๐Ÿ“š Storybook
๐Ÿ”— Preview link ๐Ÿ”— Preview link
github-actions[bot] commented 3 weeks ago

Playwright test results

passed ย 8 passed

Details

stats ย 8 tests across 3 suites
duration ย 2 minutes, 3 seconds
commit ย e1e32e8
info ย For more information, see full report

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 94.88400% with 86 lines in your changes missing coverage. Please review.

Project coverage is 31.84%. Comparing base (741665c) to head (e1e32e8). Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
packages/engine-formula/src/basics/statistical.ts 89.50% 34 Missing :warning:
...engine-formula/src/functions/logical/scan/index.ts 65.78% 13 Missing :warning:
.../engine-formula/src/functions/logical/map/index.ts 60.71% 11 Missing :warning:
...gine-formula/src/functions/logical/reduce/index.ts 70.00% 9 Missing :warning:
...ngine-formula/src/functions/lookup/offset/index.ts 75.00% 6 Missing :warning:
...ngine-formula/src/functions/logical/bycol/index.ts 66.66% 5 Missing :warning:
...ngine-formula/src/functions/logical/byrow/index.ts 66.66% 5 Missing :warning:
packages/engine-formula/src/basics/engineering.ts 85.71% 2 Missing :warning:
...la/src/functions/statistical/covariance-p/index.ts 97.77% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #3463 +/- ## ========================================== + Coverage 30.94% 31.84% +0.89% ========================================== Files 2161 2194 +33 Lines 113569 115184 +1615 Branches 24894 25374 +480 ========================================== + Hits 35148 36677 +1529 - Misses 78421 78507 +86 ``` | [Flag](https://app.codecov.io/gh/dream-num/univer/pull/3463/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dream-num) | Coverage ฮ” | | |---|---|---| | [](https://app.codecov.io/gh/dream-num/univer/pull/3463/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dream-num) | `31.84% <94.88%> (+0.89%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dream-num#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

oumomomo commented 3 weeks ago

ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=BETA.INV(0.685470581,8,10,1,3)/=CHISQ.DIST.RT(0.1,2.1)๏ผŒ่ฎก็ฎ—็ป“ๆžœ๏ผŒ่ฎก็ฎ—็ป“ๆžœ็›ธๅทฎไธ€ไฝ image image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

Enter =BETA.INV(0.685470581,8,10,1,3)/=CHISQ.DIST.RT(0.1,2.1) in the cell and calculate the result. The calculated result differs by one digit. image image

oumomomo commented 3 weeks ago

BETA.INVๅ‡ฝๆ•ฐ ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=BETA.INV(0.685470581,8,10,0,0)๏ผŒ่ฎก็ฎ—็ป“ๆžœๆœชๆŠฅ้”™ image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

BETA.INV function Enter =BETA.INV(0.685470581,8,10,0,0) in the cell, and no error is reported in the calculation result image

oumomomo commented 3 weeks ago

CHISQ.INV.RTๅ‡ฝๆ•ฐ ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=CHISQ.INV.RT(0.1,500000000000000000)๏ผŒ่ฎก็ฎ—ไธๅ‡บ็ป“ๆžœ image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

CHISQ.INV.RT function Enter =CHISQ.INV.RT(0.1,500000000000000000) in the cell, but the result cannot be calculated image

oumomomo commented 3 weeks ago

CHISQ.TEST 1ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=CHISQ.TEST(A2:B4,A6:B8)๏ผŒA8&B8ๅ•ๅ…ƒๆ ผไธบ็ฉบๆ—ถ่ฎก็ฎ—็ป“ๆžœไธๅฏน image

2ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=CHISQ.TEST(A2:B2,A6:B6)๏ผŒ่ฎก็ฎ—็ป“ๆžœไธๅฏน image

3ใ€ๅ•ๅ…ƒๆ ผ่พ“ๅ…ฅ=CHISQ.TEST(A:C,A:C)๏ผŒ่ฎก็ฎ—็ป“ๆžœไธๆŠฅ้”™ ๆ ทๅผ ๏ผšhttps://1drv.ms/x/c/c874bd32de218f8c/EY2JyRdwVlFOqkPhsZ48y4MBu63H8xNVMQZ1UMfCRuQKbw?e=hoCaQ3 image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

CHISQ.TEST

  1. Enter =CHISQ.TEST(A2:B4,A6:B8) in the cell. When cells A8&B8 are empty, the calculation result is incorrect. image

  2. Enter =CHISQ.TEST(A2:B2,A6:B6) in the cell, and the calculation result is incorrect. image

  3. Cell input =CHISQ.TEST(A:C,A:C), the calculation result will not report an error Sample: https://1drv.ms/x/c/c874bd32de218f8c/EY2JyRdwVlFOqkPhsZ48y4MBu63H8xNVMQZ1UMfCRuQKbw?e=hoCaQ3 image

oumomomo commented 3 weeks ago

CONFIDENCE.Tๅ‡ฝๆ•ฐ ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=CONFIDENCE.T(0.1,B2:A3,B5:A6:B4)๏ผŒ่ฎก็ฎ—ไธๅ‡บ็ป“ๆžœ ๆ ทๅผ ๏ผšhttps://1drv.ms/x/c/c874bd32de218f8c/EY2JyRdwVlFOqkPhsZ48y4MBu63H8xNVMQZ1UMfCRuQKbw?e=kqFcrg image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

CONFIDENCE.T function Enter =CONFIDENCE.T(0.1,B2:A3,B5:A6:B4) in the cell, but the result cannot be calculated Sample: https://1drv.ms/x/c/c874bd32de218f8c/EY2JyRdwVlFOqkPhsZ48y4MBu63H8xNVMQZ1UMfCRuQKbw?e=kqFcrg image

oumomomo commented 3 weeks ago

CORREL ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=CORREL("1+10","1+10" )๏ผŒ้”™่ฏฏ็ ไธไธ€่‡ด image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

CORREL Enter =CORREL("1+10","1+10" ) in the cell, the error codes are inconsistent image

oumomomo commented 3 weeks ago

COVARIANCE.Pๅ‡ฝๆ•ฐ 1ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=COVARIANCE.P(1.2-5,0.2+1)๏ผŒ้ข„ๆœŸไธๆŠฅ้”™ image

2ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=COVARIANCE.P("12:2","0:1")๏ผŒ้”™่ฏฏ็ ไธไธ€่‡ด image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

COVARIANCE.P function

  1. Enter =COVARIANCE.P(1.2-5,0.2+1) in the cell. No error is expected. image

  2. Enter =COVARIANCE.P("12:2","0:1") in the cell, but the error codes are inconsistent. image

oumomomo commented 3 weeks ago

COVARIANCE.Sๅ‡ฝๆ•ฐ 1ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=COVARIANCE.S(A5:A7,B5:B7)๏ผŒA6:B7ๅ•ๅ…ƒๆ ผไธบ็ฉบ๏ผŒ้ข„ๆœŸๅบ”่ฏฅๆŠฅ้”™ image image

2ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=COVARIANCE.S(A3:A5,B3:B5)๏ผŒA3:A4ไธบๆ–‡ๆœฌ๏ผŒ้ข„ๆœŸๅบ”่ฏฅๆŠฅ้”™ image

3ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=COVARIANCE.S(A3:A3,B3:B3)/=COVARIANCE.S("3-1","2+5") ๏ผŒ้”™่ฏฏ็ ไธไธ€่‡ด image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

COVARIANCE.S function

  1. Enter =COVARIANCE.S(A5:A7,B5:B7) in the cell. Cells A6:B7 are empty. It is expected that an error will be reported. image image

  2. Enter =COVARIANCE.S(A3:A5,B3:B5) in the cell. A3:A4 is text. It is expected that an error will be reported. image

  3. Enter =COVARIANCE.S(A3:A3,B3:B3)/=COVARIANCE.S("3-1","2+5") in the cell, and the error codes are inconsistent. image

oumomomo commented 3 weeks ago

ไปฅไธŠbugๅทฒ้ชŒๆ”ถ

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

The above bugs have been accepted

oumomomo commented 3 weeks ago

F.DISTๅ‡ฝๆ•ฐ

ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=F.DIST(A2:A3,A2:A4,A3:A4,FALSE)๏ผŒ่ฎก็ฎ—็ป“ๆžœไธๅฏน image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

F.DIST function

Enter =F.DIST(A2:A3,A2:A4,A3:A4,FALSE) in the cell, and the calculation result is incorrect. image

oumomomo commented 3 weeks ago

F.TESTๅ‡ฝๆ•ฐ

1ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=F.TEST(A2:A6,B2:B6)๏ผŒA2:B5ๅ•ๅ…ƒๆ ผๅ‡ไธบ็ฉบ่ฎก็ฎ—็ป“ๆžœๆœชๆŠฅ้”™ image

2ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=F.TEST(A2:A6,B2:B6)๏ผŒA3ๅ•ๅ…ƒๆ ผไธบๆ•ฐๅ€ผๅค–็š„ๅ…ถไป–ๅญ—็ฌฆไธฒ๏ผŒ่ฎก็ฎ—็ป“ๆžœไธๅฏน ๆ ทๅผ ๏ผšhttps://1drv.ms/x/c/c874bd32de218f8c/EZlUN5df4vhCiPIQNDscNJUB9cdFr0Ol1ARGGxBRzY-hPg?e=60yhoD image

3ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=F.TEST(A2:A4,B2:B6)๏ผŒ่ฎก็ฎ—ไธๅ‡บ็ป“ๆžœ ๆ ทๅผ ๏ผšhttps://1drv.ms/x/c/c874bd32de218f8c/EZlUN5df4vhCiPIQNDscNJUB9cdFr0Ol1ARGGxBRzY-hPg?e=CxwPO2 image

4ใ€ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=F.TEST(A2:A6,B2:B6)๏ผŒ่ฎก็ฎ—็ป“ๆžœๆœชๆŠฅ้”™ ๆ ทๅผ ๏ผšhttps://1drv.ms/x/c/c874bd32de218f8c/Ef0PWf4mZVRHk0Mii9SzBZ0B5DRhZn6uV24zih-j4k_PAw?e=buPhzC image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

F.TEST function

  1. Enter =F.TEST(A2:A6,B2:B6) in the cell. Cells A2:B5 are all empty and the calculation result does not report an error. image

  2. Enter =F.TEST(A2:A6,B2:B6) in the cell. Cell A3 contains strings other than numerical values, and the calculation result is incorrect. Sample: https://1drv.ms/x/c/c874bd32de218f8c/EZlUN5df4vhCiPIQNDscNJUB9cdFr0Ol1ARGGxBRzY-hPg?e=60yhoD image

  3. Enter =F.TEST(A2:A4,B2:B6) in the cell, but the result cannot be calculated. Sample: https://1drv.ms/x/c/c874bd32de218f8c/EZlUN5df4vhCiPIQNDscNJUB9cdFr0Ol1ARGGxBRzY-hPg?e=CxwPO2 image

  4. Enter =F.TEST(A2:A6,B2:B6) in the cell, and no error is reported in the calculation result. Sample: https://1drv.ms/x/c/c874bd32de218f8c/Ef0PWf4mZVRHk0Mii9SzBZ0B5DRhZn6uV24zih-j4k_PAw?e=buPhzC image

oumomomo commented 3 weeks ago

FISHERINVๅ‡ฝๆ•ฐ

ๅ•ๅ…ƒๆ ผๅ†…่พ“ๅ…ฅ=FISHERINV(9999999.23658)๏ผŒ่ฎก็ฎ—็ป“ๆžœไธๅฏน image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

FISHERINV function

Enter =FISHERINV(9999999.23658) into the cell, and the calculation result is incorrect. image

oumomomo commented 3 weeks ago

FORECAST.LINEARๅ‡ฝๆ•ฐ

ๅ•ๅ…ƒๆ ผ่พ“ๅ…ฅ=FORECAST.LINEAR(1,2,B2:B6)๏ผŒ้”™่ฏฏ็ ไธไธ€่‡ด image

univer-bot[bot] commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ

FORECAST.LINEAR function

Cell input =FORECAST.LINEAR(1,2,B2:B6), error codes are inconsistent image