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

            Bug ID: 66629
           Summary: Formula evaluator returns wrong result form sumif
                    formula
           Product: POI
           Version: 5.2.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: bkacper...@stratoflow.com
  Target Milestone: ---

Created attachment 38579
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38579&action=edit
file for demonstrating problem

Hi, 
I found a problem with sumif formula evaluation. When I evaluate formula in
cell B1 from attached file it returns unexcpected result of -36197273.86898398.
Same cell displays value -36197273.86898400 when it is opened in excel. I
created simple test that demonstrate this problem:

public void test() {
        Resource parseableResource = new
ClassPathResource("ApachePOI-sumif.xlsx");
        InputStream parseableInput = parseableResource.getInputStream();
        byte[] parseableFile = toByteArray(parseableInput);

        Workbook workbook = WorkbookReader.read(parseableFile);
        FormulaEvaluator evaluator = workbook.getCreationHelper()
        .createFormulaEvaluator();
        DataFormatter dataFormatter = new DataFormatter();

        Sheet sheet = workbook.getSheetAt(0);
        Cell cell = sheet.getRow(0).getCell(1);

        assertThat(dataFormatter.formatCellValue(cell, evaluator))
        .isEqualTo("-36197273.86898400");
}

This test fails on last assert.

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

Reply via email to