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:00:30 UTC

[Bug 70005] New: SUM(COUNTIFS) with multiple values is broken

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

            Bug ID: 70005
           Summary: SUM(COUNTIFS) with multiple values is broken
           Product: POI
           Version: 5.5.1-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: aditsu@yahoo.com
  Target Milestone: ---

SUM(COUNTIFS) with multiple values in the criteria gives the wrong result, and
is also using a wrong area check which completely breaks it depending on where
the cell with the formula is positioned.

-- 
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


[Bug 70005] SUM(COUNTIFS) with multiple values is broken

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=70005

--- Comment #2 from aditsu <ad...@yahoo.com> ---
Similar problem with SUMIF instead of COUNTIFS

-- 
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


[Bug 70005] SUM(COUNTIFS) with multiple values is broken

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=70005

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Dominik Stadler <do...@gmx.at> ---
Should be fixed via https://github.com/apache/poi/pull/1068

-- 
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


[Bug 70005] SUM(COUNTIFS) with multiple values is broken

Posted by bu...@apache.org.
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


[Bug 70005] SUM(COUNTIFS) with multiple values is broken

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=70005

Matafagafo <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matafagafo@gmail.com

-- 
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