19 function (
$index) use ($cellReference) {
22 return $cellReference->getWorksheet()->getRowDimension(
$row)->getVisible();
36 function (
$index) use ($cellReference) {
39 if ($cellReference->getWorksheet()->cellExists($column .
$row)) {
41 $isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula();
42 $cellFormula = !preg_match(
'/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue());
44 $retVal = !$isFormula || $cellFormula;
55 1 => [Statistical\Averages::class,
'average'],
56 [Statistical\Counts::class,
'COUNT'],
57 [Statistical\Counts::class,
'COUNTA'],
58 [Statistical\Maximum::class,
'max'],
59 [Statistical\Minimum::class,
'min'],
60 [Operations::class,
'product'],
61 [Statistical\StandardDeviations::class,
'STDEV'],
62 [Statistical\StandardDeviations::class,
'STDEVP'],
63 [Sum::class,
'sumIgnoringStrings'],
64 [Statistical\Variances::class,
'VAR'],
65 [Statistical\Variances::class,
'VARP'],
84 public static function evaluate($functionType, ...$args)
86 $cellReference = array_pop($args);
92 return $e->getMessage();
96 if ($subtotal > 100) {
97 $aArgs = self::filterHiddenArgs($cellReference, $aArgs);
101 $aArgs = self::filterFormulaArgs($cellReference, $aArgs);
102 if (array_key_exists($subtotal, self::CALL_FUNCTIONS)) {
104 $call = self::CALL_FUNCTIONS[$subtotal];
106 return call_user_func_array($call, $aArgs);
static validateNumericNullBool($number)
Many functions accept null/false/true argument treated as 0/0/1.
static filterFormulaArgs($cellReference, $args)
static flattenArrayIndexed($array)
Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing...
static filterHiddenArgs($cellReference, $args)