class PHPExcel_Calculation_Functions

PHPExcelCalculationFunctions

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Constants

COMPATIBILITY_EXCEL

constants

COMPATIBILITY_GNUMERIC

COMPATIBILITY_OPENOFFICE

RETURNDATE_PHP_NUMERIC

RETURNDATE_PHP_OBJECT

RETURNDATE_EXCEL

Methods

static boolean
setCompatibilityMode(string $compatibilityMode)

Set the Compatibility Mode

static string
getCompatibilityMode()

Return the current Compatibility Mode

static boolean
setReturnDateType(string $returnDateType)

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

static string
getReturnDateType()

Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)

static string
DUMMY()

DUMMY

static string
DIV0()

DIV0

static string
NA()

NA

static string
NaN()

NaN

static string
NAME()

NAME

static string
REF()

REF

static string
NULL()

NULL

static string
VALUE()

VALUE

static 
isMatrixValue($idx)

No description

static 
isValue($idx)

No description

static 
isCellValue($idx)

No description

static 
ifCondition($condition)

No description

static boolean
ERROR_TYPE(mixed $value = '')

ERROR_TYPE

static boolean
IS_BLANK(mixed $value = null)

IS_BLANK

static boolean
IS_ERR(mixed $value = '')

IS_ERR

static boolean
IS_ERROR(mixed $value = '')

IS_ERROR

static boolean
IS_NA(mixed $value = '')

IS_NA

static boolean
IS_EVEN(mixed $value = null)

IS_EVEN

static boolean
IS_ODD(mixed $value = null)

IS_ODD

static boolean
IS_NUMBER(mixed $value = null)

IS_NUMBER

static boolean
IS_LOGICAL(mixed $value = null)

IS_LOGICAL

static boolean
IS_TEXT(mixed $value = null)

IS_TEXT

static boolean
IS_NONTEXT(mixed $value = null)

IS_NONTEXT

static string
VERSION()

VERSION

static number
N(value $value = null)

N

static number
TYPE(value $value = null)

TYPE

static array
flattenArray(array $array)

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

static array
flattenArrayIndexed(array $array)

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

static mixed
flattenSingleValue(mixed $value = '')

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

Details

at line 130
static boolean setCompatibilityMode(string $compatibilityMode)

Set the Compatibility Mode

Parameters

string $compatibilityMode Compatibility Mode Permitted values are: PHPExcelCalculationFunctions::COMPATIBILITYEXCEL 'Excel' PHPExcelCalculationFunctions::COMPATIBILITYGNUMERIC 'Gnumeric' PHPExcelCalculationFunctions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'

Return Value

boolean (Success or Failure)

at line 153
static string getCompatibilityMode()

Return the current Compatibility Mode

Return Value

string Compatibility Mode Possible Return values are: PHPExcelCalculationFunctions::COMPATIBILITYEXCEL 'Excel' PHPExcelCalculationFunctions::COMPATIBILITYGNUMERIC 'Gnumeric' PHPExcelCalculationFunctions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'

at line 171
static boolean setReturnDateType(string $returnDateType)

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

Parameters

string $returnDateType Return Date Format Permitted values are: PHPExcelCalculationFunctions::RETURNDATEPHPNUMERIC 'P' PHPExcelCalculationFunctions::RETURNDATEPHPOBJECT 'O' PHPExcelCalculationFunctions::RETURNDATE_EXCEL 'E'

Return Value

boolean Success or failure

at line 194
static string getReturnDateType()

Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)

Return Value

string Return Date Format Possible Return values are: PHPExcelCalculationFunctions::RETURNDATEPHPNUMERIC 'P' PHPExcelCalculationFunctions::RETURNDATEPHPOBJECT 'O' PHPExcelCalculationFunctions::RETURNDATE_EXCEL 'E'

at line 207
static string DUMMY()

DUMMY

Return Value

string

Not Yet Implemented

at line 220
static string DIV0()

DIV0

Return Value

string

Not Yet Implemented

at line 239
static string NA()

NA

Excel Function: =NA()

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

Return Value

string

N/A!

at line 254
static string NaN()

NaN

Returns the error value #NUM!

Return Value

string

NUM!

at line 269
static string NAME()

NAME

Returns the error value #NAME?

Return Value

string

NAME?

at line 284
static string REF()

REF

Returns the error value #REF!

Return Value

string

REF!

at line 299
static string NULL()

NULL

Returns the error value #NULL!

Return Value

string

NULL!

at line 314
static string VALUE()

VALUE

Returns the error value #VALUE!

Return Value

string

VALUE!

at line 320
static isMatrixValue($idx)

Parameters

$idx

at line 326
static isValue($idx)

Parameters

$idx

at line 332
static isCellValue($idx)

Parameters

$idx

at line 338
static ifCondition($condition)

Parameters

$condition

at line 368
static boolean ERROR_TYPE(mixed $value = '')

ERROR_TYPE

Parameters

mixed $value Value to check

Return Value

boolean

at line 389
static boolean IS_BLANK(mixed $value = null)

IS_BLANK

Parameters

mixed $value Value to check

Return Value

boolean

at line 405
static boolean IS_ERR(mixed $value = '')

IS_ERR

Parameters

mixed $value Value to check

Return Value

boolean

at line 419
static boolean IS_ERROR(mixed $value = '')

IS_ERROR

Parameters

mixed $value Value to check

Return Value

boolean

at line 436
static boolean IS_NA(mixed $value = '')

IS_NA

Parameters

mixed $value Value to check

Return Value

boolean

at line 450
static boolean IS_EVEN(mixed $value = null)

IS_EVEN

Parameters

mixed $value Value to check

Return Value

boolean

at line 470
static boolean IS_ODD(mixed $value = null)

IS_ODD

Parameters

mixed $value Value to check

Return Value

boolean

at line 490
static boolean IS_NUMBER(mixed $value = null)

IS_NUMBER

Parameters

mixed $value Value to check

Return Value

boolean

at line 507
static boolean IS_LOGICAL(mixed $value = null)

IS_LOGICAL

Parameters

mixed $value Value to check

Return Value

boolean

at line 521
static boolean IS_TEXT(mixed $value = null)

IS_TEXT

Parameters

mixed $value Value to check

Return Value

boolean

at line 535
static boolean IS_NONTEXT(mixed $value = null)

IS_NONTEXT

Parameters

mixed $value Value to check

Return Value

boolean

at line 546
static string VERSION()

VERSION

Return Value

string Version information

at line 567
static number N(value $value = null)

N

Returns a value converted to a number

Parameters

value $value The value you want converted

Return Value

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

at line 605
static number TYPE(value $value = null)

TYPE

Returns a number that identifies the type of a value

Parameters

value $value The value you want tested

Return Value

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

at line 647
static array flattenArray(array $array)

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

Parameters

array $array Array to be flattened

Return Value

array Flattened array

at line 680
static array flattenArrayIndexed(array $array)

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

Parameters

array $array Array to be flattened

Return Value

array Flattened array

at line 713
static mixed flattenSingleValue(mixed $value = '')

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

Parameters

mixed $value Array or scalar value

Return Value

mixed