Add basic support for Error functions when the error is #SPILL! or #CALC!

This commit is contained in:
MarkBaker 2022-03-18 17:44:26 +01:00
parent dae5dfd6b6
commit 21b784f200
4 changed files with 22 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class ErrorValue
return false; return false;
} }
return in_array($value, ExcelError::$errorCodes); return in_array($value, ExcelError::$errorCodes) || $value === ExcelError::CALC();
} }
/** /**

View File

@ -22,6 +22,7 @@ class ExcelError
'num' => '#NUM!', 'num' => '#NUM!',
'na' => '#N/A', 'na' => '#N/A',
'gettingdata' => '#GETTING_DATA', 'gettingdata' => '#GETTING_DATA',
'spill' => '#SPILL!',
]; ];
/** /**
@ -45,6 +46,10 @@ class ExcelError
++$i; ++$i;
} }
if ($value === self::CALC()) {
return 14;
}
return self::NA(); return self::NA();
} }

View File

@ -53,4 +53,12 @@ return [
7, 7,
'#N/A', '#N/A',
], ],
[
9,
'#SPILL!',
],
[
14,
'#CALC!',
],
]; ];

View File

@ -49,6 +49,14 @@ return [
true, true,
'#N/A', '#N/A',
], ],
[
true,
'#SPILL!',
],
[
true,
'#CALC!',
],
[ [
false, false,
'TRUE', 'TRUE',