PhpSpreadsheet/tests/data/Calculation/LookupRef
Arne Jørgensen a5a0268050
Fix HLOOKUP on single row (#1512)
Fixes a bug when doing a HLOOKUP on a single row.

```php
<?php

require 'vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\Spreadsheet;

$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();

/**
 * Single row.
 */
$singleRow = "=HLOOKUP(10, {5, 10, 15}, 1, 0)";
$sheet->getCell('A1')->setValue($singleRow);

// Should echo 10, but echos '#N/A' and some PHP notices and warnings.
echo $sheet->getCell('A1')->getCalculatedValue() . PHP_EOL;

/**
 * Multiple rows.
 */
$multipleRows = "=HLOOKUP(10, {5, 10, 15; 20, 25, 30}, 1, 0)";
$sheet->getCell('A2')->setValue($multipleRows);

// Should echo: 10 and also does.
echo $sheet->getCell('A2')->getCalculatedValue() . PHP_EOL;
```

Co-authored-by: Mark Baker <mark@lange.demon.co.uk>
2020-06-19 21:06:41 +02:00
..
CHOOSE.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
COLUMNS.php COLUMNS and ROWS functions crashed in some cases 2018-01-13 18:01:50 +09:00
FORMULATEXT.php Fix for worksheet lookup for worksheets with spaces in the title 2019-07-24 22:15:35 -07:00
HLOOKUP.php Fix HLOOKUP on single row (#1512) 2020-06-19 21:06:41 +02:00
INDEX.php INDEX(): fix getting row and col numbers from references (#239) 2017-10-06 14:01:20 +09:00
LOOKUP.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
MATCH.php Fix MATCH when comparing different numeric types (#1521) 2020-06-19 20:54:04 +02:00
ROWS.php COLUMNS and ROWS functions crashed in some cases 2018-01-13 18:01:50 +09:00
VLOOKUP.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00