From de2248d1d432535f49fd728e45477879eb96c55a Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Fri, 24 May 2013 09:19:13 +0100 Subject: [PATCH] Fix for SUMIF(), COUNTIF() and related functions if condition references a blank cell, courtesy of watermark86 --- Classes/PHPExcel/Calculation/Functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/PHPExcel/Calculation/Functions.php b/Classes/PHPExcel/Calculation/Functions.php index 3e6a56db..5de66c41 100644 --- a/Classes/PHPExcel/Calculation/Functions.php +++ b/Classes/PHPExcel/Calculation/Functions.php @@ -308,6 +308,8 @@ class PHPExcel_Calculation_Functions { public static function _ifCondition($condition) { $condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition); + if (!isset($condition{0})) + $condition = '=""'; if (!in_array($condition{0},array('>', '<', '='))) { if (!is_numeric($condition)) { $condition = PHPExcel_Calculation::_wrapResult(strtoupper($condition)); } return '='.$condition;