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

Fix NA error #1490

Merged
merged 3 commits into from
Mar 15, 2023
Merged

Fix NA error #1490

merged 3 commits into from
Mar 15, 2023

Conversation

rpoetrap
Copy link
Contributor

@rpoetrap rpoetrap commented Mar 13, 2023

PR Details

Fix NA error

Description

Fix NA error

Related Issue

Motivation and Context

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your pull request. The second parameter of the newErrorFormulaArg function represents the error message, which is used to explain the error string. I purpose making the result of the CalcCellValue function an error string, and the error message of that as the error value. What do you think about that?

@rpoetrap
Copy link
Contributor Author

I had this problem when trying to use this formula =IFNA(VLOOKUP(...), ...), i thought this problem caused by the Error value in formulaArg is not #N/A?
or should I change the condition in IFNA function from arg.Value() == formulaErrorNA to arg.String == formulaErrorNA?

- Using formula error string in the result of the `CalcCellValue` function
- Using the error message in the `CalcCellValue` function returns error
- Update unit tests
@xuri xuri added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 13, 2023
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I means that using formula error string in the result of the CalcCellValue function when error occurs, and using the error message in the CalcCellValue function returns error. I have a changes for all formula functions and updates the unit tests based on your branch. For example:

result, err := f.CalcCellValue("Sheet1", "A1")
// Now, the variable 'result' was not empty when the error occurs
// result: "#N/A"
// err: "HLOOKUP no result found"

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2023

Codecov Report

Merging #1490 (a2d231b) into master (dc3bf33) will increase coverage by 0.00%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master    #1490   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files          31       31           
  Lines       24317    24320    +3     
=======================================
+ Hits        23999    24002    +3     
  Misses        210      210           
  Partials      108      108           
Flag Coverage Δ
unittests 98.69% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
calc.go 99.03% <100.00%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@rpoetrap
Copy link
Contributor Author

Oh that's perfect, btw I just added a fix to the IFNA function.

@rpoetrap rpoetrap changed the title Fix NA error on LOOKUP func Fix NA error Mar 14, 2023
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your contribution.

@xuri xuri merged commit e394f01 into qax-os:master Mar 15, 2023
fudali113 pushed a commit to fudali113/excelize that referenced this pull request Apr 17, 2023
…#1490)

- Using formula error string in the result of the `CalcCellValue` function
- Using the error message in the `CalcCellValue` function returns error
- Update unit tests
xuri pushed a commit to JDavidVR/excelize that referenced this pull request Jul 11, 2023
…#1490)

- Using formula error string in the result of the `CalcCellValue` function
- Using the error message in the `CalcCellValue` function returns error
- Update unit tests
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this pull request Oct 22, 2023
…#1490)

- Using formula error string in the result of the `CalcCellValue` function
- Using the error message in the `CalcCellValue` function returns error
- Update unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants