dream-num / univer

Univer is an open-source alternative to Google Sheets, Slides, and Docs
https://univer.ai
Apache License 2.0
5.68k stars 469 forks source link

feat(formula): add choose function #2613

Closed Dushusir closed 5 days ago

Dushusir commented 1 week ago

修复

close #2000(未修改,符合预期)

实现公式

Pull Request Checklist

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 89.79592% with 5 lines in your changes missing coverage. Please review.

Project coverage is 27.00%. Comparing base (ae4670a) to head (99ee97c).

Files Patch % Lines
...ngine-formula/src/functions/lookup/choose/index.ts 88.37% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #2613 +/- ## ========================================== + Coverage 26.95% 27.00% +0.05% ========================================== Files 1693 1694 +1 Lines 85172 85220 +48 Branches 17747 17763 +16 ========================================== + Hits 22954 23010 +56 + Misses 62218 62210 -8 ```

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

univer-bot[bot] commented 1 week ago

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

Origin Title: feat(formula): add choose function

Title: feat(formula): add choose function


修复

close #2000(未修改,符合预期)

实现公式

Pull Request Checklist

github-actions[bot] commented 1 week ago

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link
oumomomo commented 1 week ago

1、使用=SUM(A2:CHOOSE(2,A3,A4,A5))无法计算出值

image image

2、函数内输入小数点如=CHOOSE(1.5,B2,A3,A4,A5),无法计算出值 image image

3、将value设置为定义名称,输入值如=CHOOSE(2,定义名称,A3,A4,A5),结果计算过多 image excel: image

univer-bot[bot] commented 1 week ago

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

  1. The value cannot be calculated using =SUM(A2:CHOOSE(2,A3,A4,A5))

image image

  1. If you enter a decimal point in the function, such as =CHOOSE(1.5,B2,A3,A4,A5), the value cannot be calculated. image image

  2. Set value to the defined name, enter a value such as =CHOOSE(2, defined name, A3, A4, A5), the result is too many calculations image excel: image

Dushusir commented 1 week ago

1,2,3 all fixed