This repository was archived by the owner on Jan 2, 2019. It is now read-only.
SUM with SUBTOTAL #215
Open
Description
I do not know English but would like to contribute.
Using =sum() on a reference to =subtotal() excel ignores the subtotal.
I correct with the following code:
[PTBR]
Usando =sum() em uma referencia com =subtotal() o excel ignora o subtotal.
Eu corrigir com seguinte código:
1.7.9
Calculation.php
@@ -3720,8 +3720,14 @@
sscanf($reference,'%[A-Z]%d', $currentCol, $currentRow);
$cellValue = NULL;
if ($pSheet->cellExists($reference)) {
+ $parseFormula = $this->parseFormula($pSheet->getCell($reference)->getValue());
+
+ if(!isset($parseFormula['value']) || $parseFormula['value']!='SUBTOTAL('){
$returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
} else {
$returnValue[$currentRow][$currentCol] = NULL;
}