CALCULATION_REGEXP_NUMBER
CALCULATION_REGEXP_NUMBER = '[-+]?\\d*\\.?\\d+(e[-+]?\\d+)?'
Regular Expressions
$suppressFormulaErrors : bool
Flag to determine how formula errors should be handled If true, then a user error will be triggered If false, then an exception will be thrown.
$formulaError : string
Error message for any error that was raised/thrown by the calculation engine.
$cyclicFormulaCount : int
Number of iterations for cyclic formulae.
$localeBoolean : string[]
Locale-specific translations for Excel constants (True, False and Null).
$instance : \PhpOffice\PhpSpreadsheet\Calculation\Calculation
Instance of this class.
$spreadsheet : \PhpOffice\PhpSpreadsheet\Spreadsheet
Instance of the spreadsheet this Calculation Engine is using.
$calculationCache : array
Calculation cache.
$calculationCacheEnabled : bool
Calculation cache enabled.
$branchStoreKeyCounter : int
Used to generate unique store keys.
$operators : array
List of operators that can be used within formulae The true/false value indicates whether it is a binary operator or a unary operator.
$binaryOperators : array
List of binary operators (those that expect two operands).
$debugLog : \PhpOffice\PhpSpreadsheet\Calculation\Engine\Logger
The debug log generated by the calculation engine.
$referenceHelper : \PhpOffice\PhpSpreadsheet\ReferenceHelper
Reference Helper.
$cyclicReferenceStack : \PhpOffice\PhpSpreadsheet\Calculation\Engine\CyclicReferenceStack
An array of the nested cell references accessed by the calculation engine, used for the debug log.
$cyclicFormulaCounter : int
Current iteration counter for cyclic formulae If the value is 0 (or less) then cyclic formulae will throw an exception, otherwise they will iterate to the limit defined here before returning a result.
$delta : float
Epsilon Precision used for comparisons in calculations.
$localeLanguage : string
The current locale setting.
$validLocaleLanguages : string[]
List of available locale settings Note that this is read for the locale subdirectory only when requested.
$localeArgumentSeparator : string
Locale-specific argument separator for function arguments.
$excelConstants : string[]
Excel constant string translations to their PHP equivalents Constant conversion from text name/value to actual (datatyped) value.
getInstance(?\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet = null) : self
Get an instance of this class.
?\PhpOffice\PhpSpreadsheet\Spreadsheet | $spreadsheet | Injected spreadsheet for working with a PhpSpreadsheet Spreadsheet object, or NULL to create a standalone claculation engine |
calculateCellValue(\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null, bool $resetLog = true) : mixed
Calculate the value of a cell formula.
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | Cell to calculate |
bool | $resetLog | Flag indicating whether the debug log should be reset or not |
calculateFormula(string $formula, string $cellID = null, \PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : mixed
Calculate the value of a formula.
string | $formula | Formula to parse |
string | $cellID | Address of the cell to calculate |
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | Cell to calculate |
_calculateFormulaValue(string $formula, string $cellID = null, \PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : mixed
Parse a cell formula and calculate its value.
string | $formula | The formula to parse and calculate |
string | $cellID | The ID (e.g. A3) of the cell that we are calculating |
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | Cell to calculate |
extractCellRange(string $pRange = 'A1', \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet = null, bool $resetLog = true) : mixed
Extract range values.
string | $pRange | String based range representation |
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | Worksheet |
bool | $resetLog | Flag indicating whether calculation log should be reset or not |
Array of values in range if range contains more than one element. Otherwise, a single value is returned.
extractNamedRange(string $pRange = 'A1', \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet = null, bool $resetLog = true) : mixed
Extract range values.
string | $pRange | String based range representation |
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | Worksheet |
bool | $resetLog | Flag indicating whether calculation log should be reset or not |
Array of values in range if range contains more than one element. Otherwise, a single value is returned.
checkMatrixOperands(mixed $operand1, mixed $operand2, int $resize = 1) : array
Ensure that paired matrix operands are both matrices and of the same size.
mixed | $operand1 | First matrix operand |
mixed | $operand2 | Second matrix operand |
int | $resize | Flag indicating whether the matrices should be resized to match and (if so), whether the smaller dimension should grow or the larger should shrink. 0 = no resize 1 = shrink to fit 2 = extend to fit |
resizeMatricesShrink(mixed $matrix1, mixed $matrix2, int $matrix1Rows, int $matrix1Columns, int $matrix2Rows, int $matrix2Columns) : void
Ensure that paired matrix operands are both matrices of the same size.
mixed | $matrix1 | First matrix operand |
mixed | $matrix2 | Second matrix operand |
int | $matrix1Rows | Row size of first matrix operand |
int | $matrix1Columns | Column size of first matrix operand |
int | $matrix2Rows | Row size of second matrix operand |
int | $matrix2Columns | Column size of second matrix operand |
resizeMatricesExtend(mixed $matrix1, mixed $matrix2, int $matrix1Rows, int $matrix1Columns, int $matrix2Rows, int $matrix2Columns) : void
Ensure that paired matrix operands are both matrices of the same size.
mixed | $matrix1 | First matrix operand |
mixed | $matrix2 | Second matrix operand |
int | $matrix1Rows | Row size of first matrix operand |
int | $matrix1Columns | Column size of first matrix operand |
int | $matrix2Rows | Row size of second matrix operand |
int | $matrix2Columns | Column size of second matrix operand |
executeBinaryComparisonOperation(null|string $cellID, mixed $operand1, mixed $operand2, string $operation, \PhpOffice\PhpSpreadsheet\Calculation\Token\Stack $stack, bool $recursingArrays = false) : mixed
null|string | $cellID | |
mixed | $operand1 | |
mixed | $operand2 | |
string | $operation | |
\PhpOffice\PhpSpreadsheet\Calculation\Token\Stack | $stack | |
bool | $recursingArrays |
strcmpLowercaseFirst(null|string $str1, null|string $str2) : int
Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters.
null|string | $str1 | First string value for the comparison |
null|string | $str2 | Second string value for the comparison |
addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : array
Add cell reference if needed while making sure that it is the last argument.
array | $args | |
bool | $passCellReference | |
array|string | $functionCall | |
?\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell |
evaluateDefinedName(\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell, \PhpOffice\PhpSpreadsheet\DefinedName $namedRange, \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pCellWorksheet, \PhpOffice\PhpSpreadsheet\Calculation\Token\Stack $stack) : mixed|string
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | |
\PhpOffice\PhpSpreadsheet\DefinedName | $namedRange | |
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pCellWorksheet | |
\PhpOffice\PhpSpreadsheet\Calculation\Token\Stack | $stack |