Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

fix data type problem in INDEX function on LookupRef.php #735

Open
wants to merge 1 commit into
base: 1.8
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Classes/PHPExcel/Calculation/LookupRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down