You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2017/08/29 12:44:47 UTC

[Bug 61468] Regression: evaluateInCell results in incorrect value for some formulas

https://bz.apache.org/bugzilla/show_bug.cgi?id=61468

viktor@vaadin.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from viktor@vaadin.com ---
UPD: the cell is E9 (not E5 as stated above). The formula which is incorrectly
evaluated is `=TotalMonthlyIncome`.

The following code snippet produces different results in 3.15 and 3.17:
InputStream input =
Main.class.getClassLoader().getResourceAsStream("simple-monthly-budget.xlsx");
Workbook workbook = WorkbookFactory.create(input);
Cell cell = workbook.getSheetAt(0).getRow(8).getCell(4);
System.out.println("E9 numeric value (before evaluating formula): " +
cell.getNumericCellValue());
FormulaEvaluator formulaEvaluator =
workbook.getCreationHelper().createFormulaEvaluator();
formulaEvaluator.evaluateInCell(cell);
System.out.println("E9 numeric value (after evaluating formula): " +
cell.getNumericCellValue());

In 3.15:
E9 numeric value (before evaluating formula): 3750.0
E9 numeric value (after evaluating formula): 3750.0

In 3.17:
E9 numeric value (before evaluating formula): 3750.0
E9 numeric value (after evaluating formula): 3500.0

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org