Fix for SUMIF(), COUNTIF() and related functions if condition references a blank cell, courtesy of watermark86

This commit is contained in:
Mark Baker 2013-05-24 09:19:13 +01:00
parent 9331422a8a
commit de2248d1d4
1 changed files with 2 additions and 0 deletions

View File

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