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 2026/04/21 15:03:15 UTC
[Bug 70005] SUM(COUNTIFS) with multiple values is broken
https://bz.apache.org/bugzilla/show_bug.cgi?id=70005
--- Comment #1 from aditsu <ad...@yahoo.com> ---
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org