mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-30 20:18:00 +00:00
INDEX(): fix getting row and col numbers from references (#239)
Allow to use cell references as row and column in function INDEX(). Eg: ``` =INDEX(A1:B5, A9) ```
This commit is contained in:
@@ -601,6 +601,9 @@ class LookupRef
|
||||
*/
|
||||
public static function INDEX($arrayValues, $rowNum = 0, $columnNum = 0)
|
||||
{
|
||||
$rowNum = Functions::flattenSingleValue($rowNum);
|
||||
$columnNum = Functions::flattenSingleValue($columnNum);
|
||||
|
||||
if (($rowNum < 0) || ($columnNum < 0)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user