ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Calculation\Functions Class Reference
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Calculation\Functions:

Static Public Member Functions

static setCompatibilityMode ($compatibilityMode)
 Set the Compatibility Mode. More...
 
static getCompatibilityMode ()
 Return the current Compatibility Mode. More...
 
static setReturnDateType ($returnDateType)
 Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object). More...
 
static getReturnDateType ()
 Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object). More...
 
static DUMMY ()
 DUMMY. More...
 
static DIV0 ()
 DIV0. More...
 
static NA ()
 NA. More...
 
static NAN ()
 NaN. More...
 
static NAME ()
 NAME. More...
 
static REF ()
 REF. More...
 
static null ()
 NULL. More...
 
static VALUE ()
 VALUE. More...
 
static isMatrixValue ($idx)
 
static isValue ($idx)
 
static isCellValue ($idx)
 
static ifCondition ($condition)
 
static errorType ($value='')
 ERROR_TYPE. More...
 
static isBlank ($value=null)
 IS_BLANK. More...
 
static isErr ($value='')
 IS_ERR. More...
 
static isError ($value='')
 IS_ERROR. More...
 
static isNa ($value='')
 IS_NA. More...
 
static isEven ($value=null)
 IS_EVEN. More...
 
static isOdd ($value=null)
 IS_ODD. More...
 
static isNumber ($value=null)
 IS_NUMBER. More...
 
static isLogical ($value=null)
 IS_LOGICAL. More...
 
static isText ($value=null)
 IS_TEXT. More...
 
static isNonText ($value=null)
 IS_NONTEXT. More...
 
static n ($value=null)
 N. More...
 
static TYPE ($value=null)
 TYPE. More...
 
static flattenArray ($array)
 Convert a multi-dimensional array to a simple 1-dimensional array. More...
 
static flattenArrayIndexed ($array)
 Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing. More...
 
static flattenSingleValue ($value='')
 Convert an array to a single scalar value by extracting the first element. More...
 
static isFormula ($cellReference='', ?Cell $pCell=null)
 ISFORMULA. More...
 

Data Fields

const PRECISION = 8.88E-016
 
const M_2DIVPI = 0.63661977236758134307553505349006
 2 / PI. More...
 
const COMPATIBILITY_EXCEL = 'Excel'
 constants More...
 
const COMPATIBILITY_GNUMERIC = 'Gnumeric'
 
const COMPATIBILITY_OPENOFFICE = 'OpenOfficeCalc'
 
const RETURNDATE_PHP_NUMERIC = 'P'
 
const RETURNDATE_UNIX_TIMESTAMP = 'P'
 
const RETURNDATE_PHP_OBJECT = 'O'
 
const RETURNDATE_PHP_DATETIME_OBJECT = 'O'
 
const RETURNDATE_EXCEL = 'E'
 

Static Protected Attributes

static $compatibilityMode = self::COMPATIBILITY_EXCEL
 
static $returnDateType = self::RETURNDATE_EXCEL
 
static $errorCodes
 

Static Private Member Functions

static operandSpecialHandling ($operand)
 

Detailed Description

Definition at line 8 of file Functions.php.

Member Function Documentation

◆ DIV0()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::DIV0 ( )
static

DIV0.

Returns
string #Not Yet Implemented

Definition at line 153 of file Functions.php.

154 {
155 return self::$errorCodes['divisionbyzero'];
156 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor\argsOk(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor\argumentsOk(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor\argumentsOkPrecise(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Tangent\atan2(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\average(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\averageA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\averageDeviations(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Dollar\decimal(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Dollar\fractional(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMARGUMENT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSQRT(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\kurtosis(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Operations\power(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\skew(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\SLN(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\test(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validateNotZero(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\validateTrendArrays(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VAR(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARP(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARPA(), and PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\verySmallDenominator().

+ Here is the caller graph for this function:

◆ DUMMY()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::DUMMY ( )
static

DUMMY.

Returns
string #Not Yet Implemented

Definition at line 143 of file Functions.php.

144 {
145 return '#Not Yet Implemented';
146 }

◆ errorType()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::errorType (   $value = '')
static

ERROR_TYPE.

Parameters
mixed$valueValue to check
Returns
int|string

Definition at line 308 of file Functions.php.

309 {
310 $value = self::flattenSingleValue($value);
311
312 $i = 1;
313 foreach (self::$errorCodes as $errorCode) {
314 if ($value === $errorCode) {
315 return $i;
316 }
317 ++$i;
318 }
319
320 return self::NA();
321 }
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:649
$i
Definition: disco.tpl.php:19
$errorCode

References $errorCode, $i, PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\NA().

+ Here is the call graph for this function:

◆ flattenArray()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenArray (   $array)
static

Convert a multi-dimensional array to a simple 1-dimensional array.

Parameters
array | mixed$arrayArray to be flattened
Returns
array Flattened array

Definition at line 583 of file Functions.php.

584 {
585 if (!is_array($array)) {
586 return (array) $array;
587 }
588
589 $arrayValues = [];
590 foreach ($array as $value) {
591 if (is_array($value)) {
592 foreach ($value as $val) {
593 if (is_array($val)) {
594 foreach ($val as $v) {
595 $arrayValues[] = $v;
596 }
597 } else {
598 $arrayValues[] = $val;
599 }
600 }
601 } else {
602 $arrayValues[] = $value;
603 }
604 }
605
606 return $arrayValues;
607 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional\buildDatabaseWithValueRange(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional\buildDataSet(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\calculateCellValue(), PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\calculateTopTenValue(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\checkTrendArrays(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Selection\choose(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate\CONCATENATE(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\NetworkDays\count(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Counts\COUNTBLANK(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional\COUNTIF(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional\databaseFromRangeAndValue(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\WorkDay\date(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SeriesSum\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Gcd\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Lcm\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Single\futureValue(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\geometric(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\GROWTH(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\harmonic(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMPRODUCT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMSUM(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Size\large(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\logicalAnd(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\logicalOr(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\logicalXor(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\MATCH(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Maximum\max(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Maximum\maxA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\median(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Minimum\min(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Minimum\minA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\mode(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\modifiedRate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Factorial\multinomial(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\PERCENTILE(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\PERCENTRANK(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\presentValue(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\processTokenStack(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Operations\product(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sum\product(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\QUARTILE(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\RANK(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\rate(), PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues\refresh(), PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues\setDataValues(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\showTypeDetails(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\showValue(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Size\small(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sum\sumIgnoringStrings(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares\sumSquare(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares\sumXMinusYSquared(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares\sumXSquaredMinusYSquared(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares\sumXSquaredPlusYSquared(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\test(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate\TEXTJOIN(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\TREND(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\trim(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VAR(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARP(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xirrPart1(), and PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xnpvOrdered().

+ Here is the caller graph for this function:

◆ flattenArrayIndexed()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenArrayIndexed (   $array)
static

Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.

Parameters
array | mixed$arrayArray to be flattened
Returns
array Flattened array

Definition at line 616 of file Functions.php.

617 {
618 if (!is_array($array)) {
619 return (array) $array;
620 }
621
622 $arrayValues = [];
623 foreach ($array as $k1 => $value) {
624 if (is_array($value)) {
625 foreach ($value as $k2 => $val) {
626 if (is_array($val)) {
627 foreach ($val as $k3 => $v) {
628 $arrayValues[$k1 . '.' . $k2 . '.' . $k3] = $v;
629 }
630 } else {
631 $arrayValues[$k1 . '.' . $k2] = $val;
632 }
633 }
634 } else {
635 $arrayValues[$k1] = $value;
636 }
637 }
638
639 return $arrayValues;
640 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\average(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\averageA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\averageDeviations(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Counts\COUNT(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Counts\COUNTA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\kurtosis(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\skew(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sum\sumErroringStrings(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\sumSquares(), PhpOffice\PhpSpreadsheet\Calculation\Functions\TYPE(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARPA(), and PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StandardNormal\zTest().

+ Here is the caller graph for this function:

◆ flattenSingleValue()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenSingleValue (   $value = '')
static

Convert an array to a single scalar value by extracting the first element.

Parameters
mixed$valueArray or scalar value
Returns
mixed

Definition at line 649 of file Functions.php.

650 {
651 while (is_array($value)) {
652 $value = array_shift($value);
653 }
654
655 return $value;
656 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Indirect\a1Format(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization\AMORDEGRC(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization\AMORLINC(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Payments\annuity(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\AccruedInterest\atMaturity(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselI\BESSELI(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselJ\BESSELJ(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselK\BESSELK(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselY\BESSELY(), PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill\bondEquivalentYield(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate\builtinREPT(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Address\cell(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert\character(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert\code(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex\COMPLEX(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Confidence\CONFIDENCE(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertUOM\CONVERT(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\COUPDAYBS(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\COUPDAYS(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\COUPDAYSNC(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\COUPNCD(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\COUPNUM(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\COUPPCD(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\LogNormal\cumulative(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\DB(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\DDB(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Dollar\decimal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Compare\DELTA(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Rates\discount(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\HyperGeometric\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Fisher\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Weibull\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StudentT\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Exponential\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Poisson\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Normal\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\LogNormal\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\F\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\distributionLeftTail(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\distributionRightTail(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\DOLLAR(), PhpOffice\PhpSpreadsheet\Calculation\Financial\InterestRate\effective(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Erf\ERF(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ErfC\ERFC(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Erf\ERFPRECISE(), PhpOffice\PhpSpreadsheet\Calculation\Functions\errorType(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Base\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Arabic\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Text\exact(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Standardize\execute(), PhpOffice\PhpSpreadsheet\Calculation\Database\DatabaseAbstract\fieldExtract(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\FIXEDFORMAT(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\FORECAST(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Dollar\fractional(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\DateValue\fromString(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\TimeValue\fromString(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\futureValue(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Single\futureValue(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\gamma(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StandardNormal\gauss(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Compare\GESTEP(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getDay(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getMonth(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getYear(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\GROWTH(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\TimeParts\hour(), PhpOffice\PhpSpreadsheet\Calculation\Functions\ifCondition(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\IFERROR(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\IFNA(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\IFS(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMABS(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex\IMAGINARY(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMARGUMENT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCONJUGATE(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCOS(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCOSH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCOT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCSC(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCSCH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMDIV(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMEXP(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMLN(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMLOG10(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMLOG2(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMPOWER(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex\IMREAL(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSEC(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSECH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSIN(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSINH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSQRT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMSUB(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMTAN(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Matrix\index(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Search\insensitive(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Cumulative\interest(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Rates\interest(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Payments\interestPayment(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Single\interestRate(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Difference\interval(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Fisher\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StudentT\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\LogNormal\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Normal\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\inverseLeftTail(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\inverseRightTail(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isBlank(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isErr(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isError(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isEven(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isLogical(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isNa(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isNumber(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isOdd(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isText(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract\left(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Text\length(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\LINEST(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\ln(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\LOGEST(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\HLookup\lookup(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\VLookup\lookup(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Lookup\lookup(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CaseConvert\lower(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\MATCH(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract\mid(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\TimeParts\minute(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\modifiedRate(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\negative(), PhpOffice\PhpSpreadsheet\Calculation\Financial\InterestRate\nominal(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim\nonPrintable(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\NOT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise\nullFalseTrueToNumber(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\nullFalseTrueToNumber(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\nullFalseTrueToNumber(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\NUMBERVALUE(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Offset\OFFSET(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest\payment(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\PERCENTRANK(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\AccruedInterest\periodic(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\periods(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Single\periods(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Permutations\PERMUT(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Permutations\PERMUTATIONA(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\presentValue(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\presentValue(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Price\price(), PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill\price(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Price\priceAtMaturity(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Price\priceDiscounted(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Cumulative\principal(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\processTokenStack(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CaseConvert\proper(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\range(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\RANK(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest\rate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\rate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\rate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Price\received(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace\replace(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract\right(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest\schedulePayment(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\TimeParts\second(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Search\sensitive(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Hyperlink\set(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\showValue(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\SLN(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim\spaces(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\statementIf(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\statementSwitch(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace\substitute(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\SYD(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Text\test(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\TEXTFORMAT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertDecimal\toBinary(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertHex\toBinary(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertOctal\toBinary(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBinary\toDecimal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertHex\toDecimal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertOctal\toDecimal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBinary\toHex(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertDecimal\toHex(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertOctal\toHex(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Time\toIntWithNullBool(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBinary\toOctal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertDecimal\toOctal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertHex\toOctal(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\TREND(), PhpOffice\PhpSpreadsheet\Calculation\Functions\TYPE(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CaseConvert\upper(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Indirect\validateAddress(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week\validateMethod(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\validateNumericNull(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validateNumericNullBool(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validateNumericNullSubstitution(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week\validateStyle(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\VALUE(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xnpvOrdered(), PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill\yield(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Yields\yieldAtMaturity(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Yields\yieldDiscounted(), and PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StandardNormal\zTest().

+ Here is the caller graph for this function:

◆ getCompatibilityMode()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::getCompatibilityMode ( )
static

Return the current Compatibility Mode.

Returns
string Compatibility Mode Possible Return values are: Functions::COMPATIBILITY_EXCEL 'Excel' Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'

Definition at line 93 of file Functions.php.

References PhpOffice\PhpSpreadsheet\Calculation\Functions\$compatibilityMode.

Referenced by PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\baseDate(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert\convertBooleanValue(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate\convertBooleanValue(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\VarianceBase\datatypeAdjustmentBooleans(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\distributionLeftTail(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\distributionRightTail(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\YearFrac\excelBug(), PhpOffice\PhpSpreadsheet\Shared\Date\excelToDateTimeObject(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\executeBinaryComparisonOperation(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\executeNumericBinaryOperation(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Factorial\fact(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling\floorCheck1Arg(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor\floorCheck1Arg(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\getDateValue(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\AggregateBase\isAcceptedCountable(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\negative(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\sumSquares(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\AggregateBase\testAcceptedBoolean(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBase\validateValue(), and PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\DateParts\weirdCondition().

+ Here is the caller graph for this function:

◆ getReturnDateType()

◆ ifCondition()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::ifCondition (   $condition)
static

Definition at line 249 of file Functions.php.

250 {
251 $condition = self::flattenSingleValue($condition);
252
253 if ($condition === '') {
254 $condition = '=""';
255 }
256 if (!is_string($condition) || !in_array($condition[0], ['>', '<', '='])) {
257 $condition = self::operandSpecialHandling($condition);
258 if (is_bool($condition)) {
259 return '=' . ($condition ? 'TRUE' : 'FALSE');
260 } elseif (!is_numeric($condition)) {
261 $condition = Calculation::wrapResult(strtoupper($condition));
262 }
263
264 return str_replace('""""', '""', '=' . $condition);
265 }
266 preg_match('/(=|<[>=]?|>=?)(.*)/', $condition, $matches);
267 [, $operator, $operand] = $matches;
268
269 $operand = self::operandSpecialHandling($operand);
270 if (is_numeric(trim($operand, '"'))) {
271 $operand = trim($operand, '"');
272 } elseif (!is_numeric($operand) && $operand !== 'FALSE' && $operand !== 'TRUE') {
273 $operand = str_replace('"', '""', $operand);
274 $operand = Calculation::wrapResult(strtoupper($operand));
275 }
276
277 return str_replace('""""', '""', $operator . $operand);
278 }
static wrapResult($value)
Wrap string values in quotes.

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue(), PhpOffice\PhpSpreadsheet\Calculation\Functions\operandSpecialHandling(), and PhpOffice\PhpSpreadsheet\Calculation\Calculation\wrapResult().

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Database\DatabaseAbstract\buildCondition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isBlank()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isBlank (   $value = null)
static

IS_BLANK.

Parameters
mixed$valueValue to check
Returns
bool

Definition at line 330 of file Functions.php.

331 {
332 if ($value !== null) {
333 $value = self::flattenSingleValue($value);
334 }
335
336 return $value === null;
337 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue().

+ Here is the call graph for this function:

◆ isCellValue()

◆ isErr()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isErr (   $value = '')
static

IS_ERR.

Parameters
mixed$valueValue to check
Returns
bool

Definition at line 346 of file Functions.php.

347 {
348 $value = self::flattenSingleValue($value);
349
350 return self::isError($value) && (!self::isNa(($value)));
351 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isError(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\isNa().

+ Here is the call graph for this function:

◆ isError()

◆ isEven()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isEven (   $value = null)
static

IS_EVEN.

Parameters
mixed$valueValue to check
Returns
bool|string

Definition at line 392 of file Functions.php.

393 {
394 $value = self::flattenSingleValue($value);
395
396 if ($value === null) {
397 return self::NAME();
398 } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
399 return self::VALUE();
400 }
401
402 return $value % 2 == 0;
403 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue(), PhpOffice\PhpSpreadsheet\Calculation\Functions\NAME(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\VALUE().

+ Here is the call graph for this function:

◆ isFormula()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isFormula (   $cellReference = '',
?Cell  $pCell = null 
)
static

ISFORMULA.

Parameters
mixed$cellReferenceThe cell to check
Cell$pCellThe current cell (containing this formula)
Returns
bool|string

Definition at line 666 of file Functions.php.

667 {
668 if ($pCell === null) {
669 return self::REF();
670 }
671
672 preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches);
673
674 $cellReference = $matches[6] . $matches[7];
675 $worksheetName = str_replace("''", "'", trim($matches[2], "'"));
676
677 $worksheet = (!empty($worksheetName))
678 ? $pCell->getWorksheet()->getParent()->getSheetByName($worksheetName)
679 : $pCell->getWorksheet();
680
681 return $worksheet->getCell($cellReference)->isFormula();
682 }

References PhpOffice\PhpSpreadsheet\Calculation\Calculation\CALCULATION_REGEXP_CELLREF, and PhpOffice\PhpSpreadsheet\Calculation\Functions\REF().

+ Here is the call graph for this function:

◆ isLogical()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isLogical (   $value = null)
static

IS_LOGICAL.

Parameters
mixed$valueValue to check
Returns
bool

Definition at line 450 of file Functions.php.

451 {
452 $value = self::flattenSingleValue($value);
453
454 return is_bool($value);
455 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue().

+ Here is the call graph for this function:

◆ isMatrixValue()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isMatrixValue (   $idx)
static

◆ isNa()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isNa (   $value = '')
static

IS_NA.

Parameters
mixed$valueValue to check
Returns
bool

Definition at line 378 of file Functions.php.

379 {
380 $value = self::flattenSingleValue($value);
381
382 return $value === self::NA();
383 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\NA().

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\IFNA(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\isErr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isNonText()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isNonText (   $value = null)
static

IS_NONTEXT.

Parameters
mixed$valueValue to check
Returns
bool

Definition at line 478 of file Functions.php.

479 {
480 return !self::isText($value);
481 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\isText().

+ Here is the call graph for this function:

◆ isNumber()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isNumber (   $value = null)
static

IS_NUMBER.

Parameters
mixed$valueValue to check
Returns
bool

Definition at line 432 of file Functions.php.

433 {
434 $value = self::flattenSingleValue($value);
435
436 if (is_string($value)) {
437 return false;
438 }
439
440 return is_numeric($value);
441 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue().

+ Here is the call graph for this function:

◆ isOdd()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isOdd (   $value = null)
static

IS_ODD.

Parameters
mixed$valueValue to check
Returns
bool|string

Definition at line 412 of file Functions.php.

413 {
414 $value = self::flattenSingleValue($value);
415
416 if ($value === null) {
417 return self::NAME();
418 } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
419 return self::VALUE();
420 }
421
422 return abs($value) % 2 == 1;
423 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue(), PhpOffice\PhpSpreadsheet\Calculation\Functions\NAME(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\VALUE().

+ Here is the call graph for this function:

◆ isText()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isText (   $value = null)
static

IS_TEXT.

Parameters
mixed$valueValue to check
Returns
bool

Definition at line 464 of file Functions.php.

465 {
466 $value = self::flattenSingleValue($value);
467
468 return is_string($value) && !self::isError($value);
469 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\isError().

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Functions\isNonText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValue()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::isValue (   $idx)
static

Definition at line 239 of file Functions.php.

240 {
241 return substr_count($idx, '.') == 0;
242 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARA(), and PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARPA().

+ Here is the caller graph for this function:

◆ n()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::n (   $value = null)
static

N.

Returns a value converted to a number

Parameters
null | mixed$valueThe value you want converted
Returns
number N converts values listed in the following table If value is or refers to N returns A number That number A date The serial number of that date TRUE 1 FALSE 0 An error value The error value Anything else 0

Definition at line 499 of file Functions.php.

500 {
501 while (is_array($value)) {
502 $value = array_shift($value);
503 }
504
505 switch (gettype($value)) {
506 case 'double':
507 case 'float':
508 case 'integer':
509 return $value;
510 case 'boolean':
511 return (int) $value;
512 case 'string':
513 // Errors
514 if ((strlen($value) > 0) && ($value[0] == '#')) {
515 return $value;
516 }
517
518 break;
519 }
520
521 return 0;
522 }

◆ NA()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::NA ( )
static

NA.

Excel Function: =NA()

Returns the error value #N/A #N/A is the error value that means "no value is available."

Returns
string #N/A!

Definition at line 169 of file Functions.php.

170 {
171 return self::$errorCodes['na'];
172 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\GammaBase\calculateInverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta\calculateInverse(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart\chartDataSeriesValues(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart\chartDataSeriesValuesMultiLevel(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertUOM\CONVERT(), PhpOffice\PhpSpreadsheet\Calculation\Functions\errorType(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\NewtonRaphson\execute(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SumSquares\getCount(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\harmonic(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\IFS(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isNa(), PhpOffice\PhpSpreadsheet\Cell\DataValidator\isValueInList(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\LINEST(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\LOGEST(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\HLookup\lookup(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\VLookup\lookup(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Lookup\lookup(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\MATCH(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\mode(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\modeCalc(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\PERCENTRANK(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\prepareLookupArray(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\RANK(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\statementSwitch(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Formula\text(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\validateLookupArray(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\validateLookupValue(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\validateMatchType(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\validateTrendArrays(), and PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xirrPart1().

+ Here is the caller graph for this function:

◆ NAME()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::NAME ( )
static

NAME.

Returns the error value NAME?

Returns
string NAME?

Definition at line 193 of file Functions.php.

194 {
195 return self::$errorCodes['name'];
196 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Functions\isEven(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\isOdd().

+ Here is the caller graph for this function:

◆ NAN()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::NAN ( )
static

NaN.

Returns the error value #NUM!

Returns
string #NUM!

Definition at line 181 of file Functions.php.

182 {
183 return self::$errorCodes['num'];
184 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\adjustYearMonth(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling\argumentsOk(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Floor\argumentsOk(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\arrayRightDivide(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\arrayTimesEquals(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\averageDeviations(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselI\BESSELI(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselJ\BESSELJ(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselK\BESSELK(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselY\BESSELY(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise\BITLSHIFT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise\BITRSHIFT(), PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill\bondEquivalentYield(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\calculateCellValue(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Confidence\CONFIDENCE(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\LogNormal\cumulative(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Helpers\daysPerYear(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\DDB(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Dollar\decimal(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Rates\discount(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\HyperGeometric\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Fisher\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Weibull\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StudentT\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Exponential\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Poisson\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Normal\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\LogNormal\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\F\distribution(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\distributionLeftTail(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\distributionRightTail(), PhpOffice\PhpSpreadsheet\Calculation\Financial\InterestRate\effective(), PhpOffice\PhpSpreadsheet\Calculation\Database\DGet\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Base\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Standardize\execute(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\YearFrac\fraction(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Dollar\fractional(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Time\fromHMS(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\gamma(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\geometric(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\getDateValue(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getYear(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\harmonic(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMABS(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex\IMAGINARY(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMARGUMENT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCONJUGATE(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCOS(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCOSH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCOT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCSC(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMCSCH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMDIV(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMEXP(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMLN(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMLOG10(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMLOG2(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMPOWER(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMPRODUCT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex\IMREAL(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSEC(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSECH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSIN(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSINH(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMSQRT(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMSUB(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexOperations\IMSUM(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMTAN(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Difference\initialDiff(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Cumulative\interest(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Rates\interest(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Payments\interestPayment(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Single\interestRate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StudentT\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\LogNormal\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Normal\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\inverseLeftTail(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\inverseRightTail(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Size\large(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Gamma\ln(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\LOGEST(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\median(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\minusEquals(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Round\multiple(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBase\nbrConversionFormat(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\negative(), PhpOffice\PhpSpreadsheet\Calculation\Financial\InterestRate\nominal(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\numberOrNan(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest\payment(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\PERCENTILE(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\periods(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Single\periods(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Permutations\PERMUT(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Permutations\PERMUTATIONA(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\plusEquals(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Operations\power(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\power(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\presentValue(), PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill\price(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles\QUARTILE(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial\range(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest\rate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\rate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest\rateNextGuess(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Price\received(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest\schedulePayment(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Size\small(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\sumSquares(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\SYD(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared\test(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertDecimal\toBinary(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertHex\toDecimal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertDecimal\toHex(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertDecimal\toOctal(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\trim(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\unwrapResult(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateBasis(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBinary\validateBinary(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise\validateBitwiseArgument(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\validateCost(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\validateCouponPeriod(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateDiscount(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\validateFactor(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateFrequency(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertHex\validateHex(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\validateLife(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week\validateMethod(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\validateMonth(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\validateNotNegative(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validateNotNegative(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertOctal\validateOctal(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateParValue(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\validatePeriod(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\CashFlowValidations\validatePeriodType(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBase\validatePlaces(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validatePositive(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validatePrice(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\DistributionValidations\validateProbability(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\CashFlowValidations\validateRate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateRate(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\SecurityValidations\validateRedemption(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation\validateSalvage(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\SecurityValidations\validateSecurityPeriod(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise\validateShiftAmount(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week\validateStyle(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\validateXnpv(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateYield(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\wrapResult(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xirrPart1(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xirrPart2(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xnpvOrdered(), and PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill\yield().

+ Here is the caller graph for this function:

◆ null()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::null ( )
static

NULL.

Returns the error value #NULL!

Returns
string #NULL!

Definition at line 217 of file Functions.php.

218 {
219 return self::$errorCodes['null'];
220 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Calculation\processTokenStack().

+ Here is the caller graph for this function:

◆ operandSpecialHandling()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::operandSpecialHandling (   $operand)
staticprivate

Definition at line 280 of file Functions.php.

281 {
282 if (is_numeric($operand) || is_bool($operand)) {
283 return $operand;
284 } elseif (strtoupper($operand) === Calculation::getTRUE() || strtoupper($operand) === Calculation::getFALSE()) {
285 return strtoupper($operand);
286 }
287
288 // Check for percentage
289 if (preg_match('/^\-?\d*\.?\d*\s?\%$/', $operand)) {
290 return ((float) rtrim($operand, '%')) / 100;
291 }
292
293 // Check for dates
294 if (($dateValueOperand = Date::stringToExcel($operand)) !== false) {
295 return $dateValueOperand;
296 }
297
298 return $operand;
299 }
static getTRUE()
Return the locale-specific translation of TRUE.
static getFALSE()
Return the locale-specific translation of FALSE.

References PhpOffice\PhpSpreadsheet\Calculation\Calculation\getFALSE(), and PhpOffice\PhpSpreadsheet\Calculation\Calculation\getTRUE().

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Functions\ifCondition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ REF()

◆ setCompatibilityMode()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::setCompatibilityMode (   $compatibilityMode)
static

Set the Compatibility Mode.

Parameters
string$compatibilityModeCompatibility Mode Permitted values are: Functions::COMPATIBILITY_EXCEL 'Excel' Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
Returns
bool (Success or Failure)

Definition at line 69 of file Functions.php.

70 {
71 if (
72 ($compatibilityMode == self::COMPATIBILITY_EXCEL) ||
73 ($compatibilityMode == self::COMPATIBILITY_GNUMERIC) ||
74 ($compatibilityMode == self::COMPATIBILITY_OPENOFFICE)
75 ) {
76 self::$compatibilityMode = $compatibilityMode;
77
78 return true;
79 }
80
81 return false;
82 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\$compatibilityMode.

◆ setReturnDateType()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType (   $returnDateType)
static

Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object).

Parameters
string$returnDateTypeReturn Date Format Permitted values are: Functions::RETURNDATE_UNIX_TIMESTAMP 'P' Functions::RETURNDATE_PHP_DATETIME_OBJECT 'O' Functions::RETURNDATE_EXCEL 'E'
Returns
bool Success or failure

Definition at line 109 of file Functions.php.

110 {
111 if (
112 ($returnDateType == self::RETURNDATE_UNIX_TIMESTAMP) ||
113 ($returnDateType == self::RETURNDATE_PHP_DATETIME_OBJECT) ||
114 ($returnDateType == self::RETURNDATE_EXCEL)
115 ) {
116 self::$returnDateType = $returnDateType;
117
118 return true;
119 }
120
121 return false;
122 }

References PhpOffice\PhpSpreadsheet\Calculation\Functions\$returnDateType.

Referenced by PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\dynamicFilterDateRange(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\getDateValue(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\getTimeValue(), PhpOffice\PhpSpreadsheet\Writer\Xls\save(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\save(), and PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\VALUE().

+ Here is the caller graph for this function:

◆ TYPE()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::TYPE (   $value = null)
static

TYPE.

Returns a number that identifies the type of a value

Parameters
null | mixed$valueThe value you want tested
Returns
number N converts values listed in the following table If value is or refers to N returns A number 1 Text 2 Logical Value 4 An error value 16 Array or Matrix 64

Definition at line 539 of file Functions.php.

540 {
541 $value = self::flattenArrayIndexed($value);
542 if (is_array($value) && (count($value) > 1)) {
543 end($value);
544 $a = key($value);
545 // Range of cells is an error
546 if (self::isCellValue($a)) {
547 return 16;
548 // Test for Matrix
549 } elseif (self::isMatrixValue($a)) {
550 return 64;
551 }
552 } elseif (empty($value)) {
553 // Empty Cell
554 return 1;
555 }
556 $value = self::flattenSingleValue($value);
557
558 if (($value === null) || (is_float($value)) || (is_int($value))) {
559 return 1;
560 } elseif (is_bool($value)) {
561 return 4;
562 } elseif (is_array($value)) {
563 return 64;
564 } elseif (is_string($value)) {
565 // Errors
566 if ((strlen($value) > 0) && ($value[0] == '#')) {
567 return 16;
568 }
569
570 return 2;
571 }
572
573 return 0;
574 }
static flattenArrayIndexed($array)
Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
Definition: Functions.php:616

References PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenArrayIndexed(), and PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenSingleValue().

+ Here is the call graph for this function:

◆ VALUE()

static PhpOffice\PhpSpreadsheet\Calculation\Functions::VALUE ( )
static

VALUE.

Returns the error value VALUE!

Returns
string VALUE!

Definition at line 229 of file Functions.php.

230 {
231 return self::$errorCodes['value'];
232 }

Referenced by PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Indirect\a1Format(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\average(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\averageDeviations(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Days\between(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Days360\between(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate\builtinREPT(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\calculateCellValue(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Roman\calculateRoman(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Address\cell(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert\character(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Selection\choose(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert\code(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation\COLUMNS(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex\COMPLEX(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertUOM\CONVERT(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends\CORREL(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\countTrueValues(), PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons\COUPDAYBS(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions\determinant(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\DOLLAR(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\Erf\ERF(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ErfC\ERFC(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Base\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Arabic\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Gcd\evaluate(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\executeNumericBinaryOperation(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\DateValue\finalResults(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\FIXEDFORMAT(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\DateValue\fromString(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\TimeValue\fromString(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StandardNormal\gauss(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\getDateValue(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getDay(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions\getMatrix(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getMonth(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getYear(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions\identity(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions\IMPOWER(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Search\insensitive(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Difference\interval(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions\inverse(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isEven(), PhpOffice\PhpSpreadsheet\Calculation\Functions\isOdd(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Size\large(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract\left(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\logicalAnd(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\logicalOr(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\logicalXor(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract\mid(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\modifiedRate(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions\multiply(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations\NOT(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Current\now(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\NUMBERVALUE(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Cumulative\principal(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Operations\product(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sum\product(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\Periodic\rate(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract\right(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation\ROWS(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Search\sensitive(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\skew(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Size\small(), PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional\statementSwitch(), PhpOffice\PhpSpreadsheet\Shared\Date\stringToExcel(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Roman\styleOk(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sum\sumErroringStrings(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations\sumSquares(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Lcm\testNonNulls(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Current\today(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Time\toIntWithNullBool(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages\Mean\trim(), PhpOffice\PhpSpreadsheet\Calculation\Web\Service\urlEncode(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateBasis(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise\validateBitwiseArgument(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations\validateBool(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week\validateDateValue(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertDecimal\validateDecimal(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\EngineeringValidations\validateFloat(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateFloat(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations\validateFloat(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\LookupBase\validateIndexLookup(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\EngineeringValidations\validateInt(), PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations\validateInt(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\LookupRefValidations\validateInt(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations\validateInt(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week\validateMethod(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\validateNotNegative(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\validateNumericNull(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validateNumericNullBool(), PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validateNumericNullSubstitution(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBase\validatePlaces(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\LookupRefValidations\validatePositiveInt(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise\validateShiftAmount(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week\validateStyle(), PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBase\validateValue(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\validateXnpv(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\VALUE(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARA(), PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances\VARPA(), PhpOffice\PhpSpreadsheet\Calculation\Web\Service\webService(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xirrPart2(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xirrPart3(), PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Variable\NonPeriodic\xnpvOrdered(), and PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StandardNormal\zTest().

+ Here is the caller graph for this function:

Field Documentation

◆ $compatibilityMode

PhpOffice\PhpSpreadsheet\Calculation\Functions::$compatibilityMode = self::COMPATIBILITY_EXCEL
staticprotected

◆ $errorCodes

PhpOffice\PhpSpreadsheet\Calculation\Functions::$errorCodes
staticprotected
Initial value:
= [
'null' => '#NULL!',
'divisionbyzero' => '#DIV/0!',
'value' => '#VALUE!',
'reference' => '#REF!',
'name' => '#NAME?',
'num' => '#NUM!',
'na' => '#N/A',
'gettingdata' => '#GETTING_DATA',
]

Definition at line 47 of file Functions.php.

◆ $returnDateType

PhpOffice\PhpSpreadsheet\Calculation\Functions::$returnDateType = self::RETURNDATE_EXCEL
staticprotected

◆ COMPATIBILITY_EXCEL

◆ COMPATIBILITY_GNUMERIC

◆ COMPATIBILITY_OPENOFFICE

◆ M_2DIVPI

const PhpOffice\PhpSpreadsheet\Calculation\Functions::M_2DIVPI = 0.63661977236758134307553505349006

◆ PRECISION

◆ RETURNDATE_EXCEL

◆ RETURNDATE_PHP_DATETIME_OBJECT

const PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_DATETIME_OBJECT = 'O'

◆ RETURNDATE_PHP_NUMERIC

const PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_NUMERIC = 'P'

◆ RETURNDATE_PHP_OBJECT

const PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_OBJECT = 'O'

Definition at line 24 of file Functions.php.

◆ RETURNDATE_UNIX_TIMESTAMP


The documentation for this class was generated from the following file: