Skip to content

Commit cb81f44

Browse files
authored
Merge branch 'master' into ChartSheet
2 parents a33ed02 + db00b90 commit cb81f44

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
2929
### Fixed
3030

3131
- Xls Reader resolving absolute named ranges to relative ranges [Issue #2826](https://github.com/PHPOffice/PhpSpreadsheet/issues/2826) [PR #2827](https://github.com/PHPOffice/PhpSpreadsheet/pull/2827)
32+
- Null value handling in the Excel Math/Trig PRODUCT() function [Issue #2833](https://github.com/PHPOffice/PhpSpreadsheet/issues/2833) [PR #2834](https://github.com/PHPOffice/PhpSpreadsheet/pull/2834)
3233

3334

3435
## 1.23.0 - 2022-04-24

src/PhpSpreadsheet/Calculation/MathTrig/Operations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static function product(...$args)
108108
// Loop through arguments
109109
foreach (Functions::flattenArray($args) as $arg) {
110110
// Is it a numeric value?
111-
if (is_numeric($arg)) {
111+
if (is_numeric($arg) || $arg === null) {
112112
if ($returnValue === null) {
113113
$returnValue = $arg;
114114
} else {

tests/data/Calculation/MathTrig/PRODUCT.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@
4848
-6.7800000000000002,
4949
-2,
5050
],
51+
[
52+
0,
53+
12.5,
54+
null,
55+
2.5,
56+
],
57+
[
58+
0,
59+
12.5,
60+
2.5,
61+
null,
62+
],
5163
['#VALUE!', 1, 'y', 3],
5264
[6, 1, '2', 3],
5365
];

0 commit comments

Comments
 (0)