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:
Maxim
2017-10-06 08:01:20 +03:00
committed by Adrien Crivelli
parent 088a76737e
commit 4b4bac53aa
2 changed files with 17 additions and 0 deletions
@@ -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();
}