PhpSpreadsheet/tests
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
..
PhpSpreadsheetTests Fix for #1505 (#1525) 2020-06-19 21:01:18 +02:00
data Fix HLOOKUP on single row (#1512) 2020-06-19 21:06:41 +02:00
bootstrap.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00