HLOOKUP check on the count of the rows, not columns
We must check on the count of the rows (`row_index_num` and not `col_index_num` as in VLOOKUP) and not on the columns. https://support.office.com/en-us/article/HLOOKUP-function-a3034eec-b719-4ba3-bb65-e1ad662ed95f Fixes https://github.com/PHPOffice/PHPExcel/issues/1339
This commit is contained in:
parent
25ff914aa6
commit
a093a468d1
|
@ -789,7 +789,7 @@ class LookupRef
|
|||
}
|
||||
$f = array_keys($lookup_array);
|
||||
$firstRow = array_pop($f);
|
||||
if ((!is_array($lookup_array[$firstRow])) || ($index_number - 1 > count($lookup_array[$firstRow]))) {
|
||||
if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array))) {
|
||||
return Functions::REF();
|
||||
}
|
||||
$columnKeys = array_keys($lookup_array[$firstRow]);
|
||||
|
|
Loading…
Reference in New Issue