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

--- Comment #1 from aditsu <[email protected]> ---
Created attachment 40166
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=40166&action=edit
test case

kotlin test code:

import org.apache.poi.ss.usermodel.Cell
import org.apache.poi.ss.usermodel.CellType
import org.apache.poi.ss.usermodel.FormulaEvaluator
import org.apache.poi.ss.usermodel.WorkbookFactory
import java.io.File

private fun test(cell: Cell, eval: FormulaEvaluator) {
        val type = eval.evaluateFormulaCell(cell)
        if (type == CellType.NUMERIC) {
                println("${cell.address}: ${cell.numericCellValue}")
        }
        else {
                println("${cell.address}: type $type")
        }
}

fun main() {
        val path = "/home/aditsu/Documents/countifs.xlsx"
        val wb = WorkbookFactory.create(File(path))
        val eval = wb.creationHelper.createFormulaEvaluator()
        val sheet = wb.getSheetAt(0)
        for (row in 2..3) {
                test(sheet.getRow(row).getCell(0), eval)
        }
        for (row in 2..3) {
                test(sheet.getRow(row).getCell(3), eval)
        }
}

Expected results (tested in both Excel and LibreOffice Calc):
A3: 3.0
A4: 4.0
D3: 3.0
D4: 4.0

Actual results:
A3: 2.0
A4: 2.0
D3: type ERROR
D4: type ERROR

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to