-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
None
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
attached xlsx sample
Current Result
In 5.8.0, the formula =SUMPRODUCT(–({true; true; false}) (not an actual array, just showing the result of the LEN function in the example) has the result value "1"
Expected Result
Expected value is "2"
Debug Information
org.zkoss.poi.ss.formula.functions.OverridableFunction.evaluate(ValueEval[], int, int, boolean)
calls
org.zkoss.poi.ss.formula.functions.Fixed1ArgFunction.evaluate(ValueEval[], int, int)
which calls
org.zkoss.poi.ss.formula.functions.Fixed1ArgFunction.evaluate(ValueEval[], int, int, boolean)
with the isArrayValue boolean set to false
This causes the resulting arg passed to the outer formula to be a org.zkoss.poi.ss.formula.eval.NumberEval instead of the expected org.zkoss.poi.ss.formula.eval.ArrayEval
Since sumproduct should apply the double minus sign conversion from boolean to int (1 or 0), the sum applied to the array should return an integer equal to the number of "true" values in the array
Workaround
N/A
- relates to
-
KEIKAI-479 SUMPRODUCT() in IF() doesn't return the expected result
- Closed