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 Text/Math/Lookup formulas #2842

Merged
merged 12 commits into from
Jul 27, 2024
Merged

Conversation

wpxp123456
Copy link
Contributor

close #2802

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 feature request New feature or request scope:formula labels Jul 23, 2024
@wzhudev wzhudev removed the feature request New feature or request label Jul 23, 2024
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 81.11218% with 197 lines in your changes missing coverage. Please review.

Project coverage is 27.56%. Comparing base (43220a1) to head (de7e1e6).

Files Patch % Lines
...ngine-formula/src/functions/lookup/sortby/index.ts 78.88% 38 Missing ⚠️
...gine-formula/src/functions/text/textsplit/index.ts 71.31% 37 Missing ⚠️
...ngine-formula/src/functions/lookup/filter/index.ts 57.97% 29 Missing ⚠️
...gine-formula/src/functions/text/textafter/index.ts 78.26% 25 Missing ⚠️
...ine-formula/src/functions/text/textbefore/index.ts 78.26% 25 Missing ⚠️
.../engine-formula/src/functions/lookup/sort/index.ts 80.80% 24 Missing ⚠️
...ngine-formula/src/functions/lookup/unique/index.ts 95.00% 5 Missing ⚠️
...e-formula/src/functions/lookup/choosecols/index.ts 89.47% 4 Missing ⚠️
...e-formula/src/functions/lookup/chooserows/index.ts 88.23% 4 Missing ⚠️
...es/engine-formula/src/functions/text/rept/index.ts 92.10% 3 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2842      +/-   ##
==========================================
+ Coverage   26.97%   27.56%   +0.59%     
==========================================
  Files        1791     1806      +15     
  Lines       94485    95528    +1043     
  Branches    20159    20558     +399     
==========================================
+ Hits        25489    26335     +846     
- Misses      68996    69193     +197     

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

@wpxp123456 wpxp123456 added qa:untested This PR is ready to be tested and removed scope:formula labels Jul 23, 2024
Copy link

github-actions bot commented Jul 23, 2024

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

@oumomomo
Copy link

oumomomo commented Jul 23, 2024

REPT函数
1、
输入=REPT(",,,",987654321)&=REPT("",-1),计算结果展示为空单元格未报错
image

2、
输入=REPT(F8,H7),F8=1&H7=11,删除H列,计算结果未报错
image

@univer-bot
Copy link

univer-bot bot commented Jul 23, 2024

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

REPT function
1,
Enter =REPT(",,,",987654321)&=REPT("",-1), the calculation result is displayed as an empty cell and no error is reported
image

2,
Input =REPT(F8,H7), F8=1&H7=11, delete column H, and no error is reported in the calculation result
image

@univer-bot univer-bot bot removed the qa:untested This PR is ready to be tested label Jul 23, 2024
@oumomomo
Copy link

oumomomo commented Jul 23, 2024

TEXTAFTER函数
1、
输入=TEXTAFTER/TEXTBEFORE(A3,"红色",,FALSE),A3单元格为空,错误码不一致
image

2、
输入=TEXTAFTER(A2,"",,,1),A2单元格为马斯库.奥雷利乌斯,计算不出结果
image

3、
输入=TEXTAFTER(A3," ",,,0),A3单元格为苏格拉底,错误码不一致(注意单元格“”内有个空格)
image

4、
输入=IF(TEXTAFTER(A3," ",,,1)="",A3),A3单元格为苏格拉底,计算不出结果
image

5、
输入=TEXTAFTER(A4," ",,,1),A4单元格为康德,excel计算结果为空,我们为错误码
image

@univer-bot
Copy link

univer-bot bot commented Jul 23, 2024

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

TEXTAFTER function
1,
Input =TEXTAFTER/TEXTBEFORE(A3,"red",,FALSE), cell A3 is empty, and the error codes are inconsistent
image

2,
Input =TEXTAFTER(A2,"",,,1), cell A2 is Masku.Aurelius, the result cannot be calculated
image

Input =TEXTAFTER(A3," ",,,0), cell A3 is Socrates, the error code is inconsistent (note that there is a space in the cell "")
image

Input =IF(TEXTAFTER(A3," ",,,1)="",A3), cell A3 is Socrates, the result cannot be calculated
image

Input =TEXTAFTER(A4," ",,,1), cell A4 is Kant, the excel calculation result is empty, and we are the error code
image

@oumomomo
Copy link

oumomomo commented Jul 24, 2024

AREAS函数
1、
引用多选区时计算不出结果
image

@univer-bot
Copy link

univer-bot bot commented Jul 24, 2024

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

AREAS function
1,
The result cannot be calculated when referencing multiple selections
image

@dream-num dream-num deleted a comment from univer-bot bot Jul 24, 2024
@oumomomo
Copy link

FILTER函数
可复制样张的内容:https://dev.univer.plus/sheet/?unit=ZXTThy2MQl-5LuNMe0jIZQ&type=2&subunit=QFTlbrQA95aIDGHoprM53

1、
输入=SORT(FILTER(A5:D20,(C5:C20=H5)*(A5:A20=F5),""),4,-1),单元格计算结果为空未报错
image

@univer-bot
Copy link

univer-bot bot commented Jul 24, 2024

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

FILTER function
The content of the sample can be copied: https://dev.univer.plus/sheet/?unit=ZXTThy2MQl-5LuNMe0jIZQ&type=2&subunit=QFTlbrQA95aIDGHoprM53

1,
Input =SORT(FILTER(A5:D20,(C5:C20=H5)*(A5:A20=F5),""),4,-1), the cell calculation result is empty and no error is reported
image

@oumomomo
Copy link

oumomomo commented Jul 24, 2024

SORTBY函数
可用来复制的样张:https://dev.univer.plus/sheet/?unit=uaICHkclSwyqlXcfXsLmkQ&type=2&subunit=wxbCa8KjvnfGLmnaqHeZE
1、
输入:=SORTBY(A2:A9,1)/=SORTBY(A2:A9,B2:B9),计算不出结果
image

2、删除引用列,错误码不一致
image

@univer-bot
Copy link

univer-bot bot commented Jul 24, 2024

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

SORTBY function
Samples available for reproduction: https://dev.univer.plus/sheet/?unit=uaICHkclSwyqlXcfXsLmkQ&type=2&subunit=wxbCa8KjvnfGLmnaqHeZE
1,
Input: =SORTBY(A2:A9,1)/=SORTBY(A2:A9,B2:B9), the result cannot be calculated
image

  1. Delete the reference column and the error code is inconsistent.
    image

@wpxp123456 wpxp123456 force-pushed the feat/add-text-func branch from 8741b7f to d57591b Compare July 27, 2024 02:39
@oumomomo
Copy link

除TEXTAFTER函数一个错误码问题,其他问题均已修复

输入=TEXTAFTER/TEXTBEFORE(A3,"红色",,FALSE),A3单元格为空,错误码不一致
image

@univer-bot
Copy link

univer-bot bot commented Jul 27, 2024

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

Except for an error code issue with the TEXTAFTER function, all other issues have been fixed.

Input =TEXTAFTER/TEXTBEFORE(A3,"red",,FALSE), cell A3 is empty, and the error codes are inconsistent
image

@oumomomo oumomomo added the qa:verified This PR has already by verified by a QA and is considered good enough to be merge label Jul 27, 2024
@univer-bot univer-bot bot removed the qa:rejected label Jul 27, 2024
@wpxp123456 wpxp123456 force-pushed the feat/add-text-func branch from db0087b to de7e1e6 Compare July 27, 2024 12:19
@wpxp123456 wpxp123456 merged commit 778e371 into dev Jul 27, 2024
9 checks passed
@wpxp123456 wpxp123456 deleted the feat/add-text-func branch July 27, 2024 12:32
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.

[Feature] More Text Formulas
4 participants