PhpSpreadsheet/tests/data/Calculation/LookupRef/INDEX.php
Maxim 4b4bac53aa 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)
```
2017-10-06 14:01:20 +09:00

91 lines
1.6 KiB
PHP

<?php
return [
[
[20 => ['R' => 1]], // Expected
// Input
[20 => ['R' => 1]],
],
[
'#VALUE!', // Expected
// Input
[
20 => ['R' => 1],
21 => ['R' => 2],
],
-1,
],
[
'#REF!', // Expected
// Input
[
20 => ['R' => 1],
21 => ['R' => 2],
],
10,
],
[
[21 => ['R' => 2]], // Expected
// Input
[
20 => ['R' => 1],
21 => ['R' => 2],
],
2,
],
[
[21 => ['R' => 2, 'S' => 4]], // Expected
// Input
[
'20' => ['R' => 1, 'S' => 3],
'21' => ['R' => 2, 'S' => 4],
],
2,
0,
],
[
'#VALUE!', // Expected
// Input
[
'20' => ['R' => 1, 'S' => 3],
'21' => ['R' => 2, 'S' => 4],
],
2,
-1,
],
[
'#VALUE!', // Expected
// Input
[
'20' => ['R' => 1, 'S' => 3],
'21' => ['R' => 2, 'S' => 4],
],
2,
10,
],
[
4, // Expected
// Input
[
'20' => ['R' => 1, 'S' => 3],
'21' => ['R' => 2, 'S' => 4],
],
2,
2,
],
[
4, // Expected
// Input
[
'20' => ['R' => 1, 'S' => 3],
'21' => ['R' => 2, 'S' => 4],
],
[
'21' => ['R' => 2],
],
[
'21' => ['R' => 2],
],
],
];