-
Notifications
You must be signed in to change notification settings - Fork 270
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
Some address expression references to an empty cell should return zero #559
Comments
Here's sample code and a sample workbook issue559.xlsx.
One workaround is to, where necessary, multiply by 1 any reference to a potentially empty cell, so that EPPlus resolves it to a zero. |
Since this is a critical defect for my customer, I took a stab at fixing this: #561 |
I had to amend PR #561 as NamedValueExpression's compile method also had to resolve references to empty cells. |
Excel and EPPlus behave differently when assigning one cell to the value of an empty cell. I attempted to make a fix on my own, but my fix broke 6 existing (and previously passing) tests. Looking into why they broke, the context of the empty cell reference matters, but I don't know how to properly detect or communicate that where needed.
Given A1 is empty or blank...
Example 1: In formula
ISBLANK(A1)
, A1 should evaluate to null so that ISBLANK(null) can evaluate to true. [working 👍 ]Example 2: In formula
A1
, A1 should evaluate to 0. [not working 👎 ]Example 3: In formula
A1\*3
, A1 should evaluate to 0 so that 0*3 can evaluate to 0. [working 👍 ]Example 4: In formula
IF(TRUE,A1)
, A1 should evaluate to 0, so that IF(TRUE,0) evaluates to 0. [not working 👎 ]In my very rough understanding of the code base, it's as though ExcelAddressExpression needs more information as to the context in which it is referenced in order to be compiled appropriately.
I will upload a sample shortly.
The text was updated successfully, but these errors were encountered: