diff --git a/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php b/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php index dabe7d1c..cffad6a6 100644 --- a/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php +++ b/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php @@ -47,7 +47,7 @@ class ErrorValue return false; } - return in_array($value, ExcelError::$errorCodes); + return in_array($value, ExcelError::$errorCodes) || $value === ExcelError::CALC(); } /** diff --git a/src/PhpSpreadsheet/Calculation/Information/ExcelError.php b/src/PhpSpreadsheet/Calculation/Information/ExcelError.php index e0f40848..585dfdc8 100644 --- a/src/PhpSpreadsheet/Calculation/Information/ExcelError.php +++ b/src/PhpSpreadsheet/Calculation/Information/ExcelError.php @@ -22,6 +22,7 @@ class ExcelError 'num' => '#NUM!', 'na' => '#N/A', 'gettingdata' => '#GETTING_DATA', + 'spill' => '#SPILL!', ]; /** @@ -45,6 +46,10 @@ class ExcelError ++$i; } + if ($value === self::CALC()) { + return 14; + } + return self::NA(); } diff --git a/tests/data/Calculation/Information/ERROR_TYPE.php b/tests/data/Calculation/Information/ERROR_TYPE.php index b08d69a6..45f27970 100644 --- a/tests/data/Calculation/Information/ERROR_TYPE.php +++ b/tests/data/Calculation/Information/ERROR_TYPE.php @@ -53,4 +53,12 @@ return [ 7, '#N/A', ], + [ + 9, + '#SPILL!', + ], + [ + 14, + '#CALC!', + ], ]; diff --git a/tests/data/Calculation/Information/IS_ERROR.php b/tests/data/Calculation/Information/IS_ERROR.php index 0755fd81..24e864fe 100644 --- a/tests/data/Calculation/Information/IS_ERROR.php +++ b/tests/data/Calculation/Information/IS_ERROR.php @@ -49,6 +49,14 @@ return [ true, '#N/A', ], + [ + true, + '#SPILL!', + ], + [ + true, + '#CALC!', + ], [ false, 'TRUE',