From bc20739906f8a5970f73788ee57ca432b1639e40 Mon Sep 17 00:00:00 2001 From: sevillacode Date: Sat, 14 Nov 2015 14:40:54 +0100 Subject: [PATCH] fix data type problem in INDEX function on LookupRef.php --- Classes/PHPExcel/Calculation/LookupRef.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Classes/PHPExcel/Calculation/LookupRef.php b/Classes/PHPExcel/Calculation/LookupRef.php index d86055121..ba3d74502 100644 --- a/Classes/PHPExcel/Calculation/LookupRef.php +++ b/Classes/PHPExcel/Calculation/LookupRef.php @@ -598,6 +598,16 @@ public static function MATCH($lookup_value, $lookup_array, $match_type = 1) */ public static function INDEX($arrayValues, $rowNum = 0, $columnNum = 0) { + + if(is_array($rowNum)){ + foreach($rowNum as $k=>$v){ + foreach($v as $k2=>$v2){ + $rowNum = $v2; + break 2; + } + } + } + if (($rowNum < 0) || ($columnNum < 0)) { return PHPExcel_Calculation_Functions::VALUE(); }