PhpSpreadsheet/tests/data/Calculation
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
..
DateTime Calcualtion - DATEDIF - fix result for Y & YM units (#1466) 2020-05-25 21:33:48 +02:00
Engineering Refactor engineering tests (#1106) 2019-07-25 21:02:41 +02:00
Financial Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Functions Fixed Functions->ifCondition for allowing <> and empty condition 2019-11-17 21:03:11 +01:00
Logical Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
LookupRef Fix HLOOKUP on single row (#1512) 2020-06-19 21:06:41 +02:00
MathTrig Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Statistical Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
TextData Upgrade to phpunit 7.5 2019-07-24 23:45:43 -07:00
Calculation.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
FunctionsAsString.php MATCH with a static array should return the position of the found value based on the values submitted. 2020-04-26 22:09:31 +09:00