\PHPExcel_Calculation_Functions

PHPExcel_Calculation_Functions

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

Summary

Methods
Properties
Constants
setCompatibilityMode()
getCompatibilityMode()
setReturnDateType()
getReturnDateType()
DUMMY()
DIV0()
NA()
NaN()
NAME()
REF()
NULL()
VALUE()
isMatrixValue()
isValue()
isCellValue()
ifCondition()
ERROR_TYPE()
IS_BLANK()
IS_ERR()
IS_ERROR()
IS_NA()
IS_EVEN()
IS_ODD()
IS_NUMBER()
IS_LOGICAL()
IS_TEXT()
IS_NONTEXT()
VERSION()
N()
TYPE()
flattenArray()
flattenArrayIndexed()
flattenSingleValue()
No public properties found
COMPATIBILITY_EXCEL
COMPATIBILITY_GNUMERIC
COMPATIBILITY_OPENOFFICE
RETURNDATE_PHP_NUMERIC
RETURNDATE_PHP_OBJECT
RETURNDATE_EXCEL
No protected methods found
$compatibilityMode
$returnDateType
$errorCodes
N/A
No private methods found
No private properties found
N/A

Constants

COMPATIBILITY_EXCEL

COMPATIBILITY_EXCEL = 'Excel'

constants

COMPATIBILITY_GNUMERIC

COMPATIBILITY_GNUMERIC = 'Gnumeric'

COMPATIBILITY_OPENOFFICE

COMPATIBILITY_OPENOFFICE = 'OpenOfficeCalc'

RETURNDATE_PHP_NUMERIC

RETURNDATE_PHP_NUMERIC = 'P'

RETURNDATE_PHP_OBJECT

RETURNDATE_PHP_OBJECT = 'O'

RETURNDATE_EXCEL

RETURNDATE_EXCEL = 'E'

Properties

$compatibilityMode

$compatibilityMode : string

Compatibility mode to use for error checking and responses

Type

string

$returnDateType

$returnDateType : string

Data Type to use when returning date values

Type

string

$errorCodes

$errorCodes : array

List of error codes

Type

array

Methods

setCompatibilityMode()

setCompatibilityMode(string  $compatibilityMode) : boolean

Set the Compatibility Mode

Parameters

string $compatibilityMode

Compatibility Mode Permitted values are: PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel' PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'

Returns

boolean —

(Success or Failure)

getCompatibilityMode()

getCompatibilityMode() : string

Return the current Compatibility Mode

Returns

string —

Compatibility Mode Possible Return values are: PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel' PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'

setReturnDateType()

setReturnDateType(string  $returnDateType) : boolean

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: PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P' PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O' PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E'

Returns

boolean —

Success or failure

getReturnDateType()

getReturnDateType() : string

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

Returns

string —

Return Date Format Possible Return values are: PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P' PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O' PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E'

DUMMY()

DUMMY() : string

DUMMY

Returns

string —

Not Yet Implemented

DIV0()

DIV0() : string

DIV0

Returns

string —

Not Yet Implemented

NA()

NA() : string

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!

NaN()

NaN() : string

NaN

Returns the error value #NUM!

Returns

string —

NUM!

NAME()

NAME() : string

NAME

Returns the error value #NAME?

Returns

string —

NAME?

REF()

REF() : string

REF

Returns the error value #REF!

Returns

string —

REF!

NULL()

NULL() : string

NULL

Returns the error value #NULL!

Returns

string —

NULL!

VALUE()

VALUE() : string

VALUE

Returns the error value #VALUE!

Returns

string —

VALUE!

isMatrixValue()

isMatrixValue(  $idx) 

Parameters

$idx

isValue()

isValue(  $idx) 

Parameters

$idx

isCellValue()

isCellValue(  $idx) 

Parameters

$idx

ifCondition()

ifCondition(  $condition) 

Parameters

$condition

ERROR_TYPE()

ERROR_TYPE(mixed  $value = '') : boolean

ERROR_TYPE

Parameters

mixed $value

Value to check

Returns

boolean

IS_BLANK()

IS_BLANK(mixed  $value = null) : boolean

IS_BLANK

Parameters

mixed $value

Value to check

Returns

boolean

IS_ERR()

IS_ERR(mixed  $value = '') : boolean

IS_ERR

Parameters

mixed $value

Value to check

Returns

boolean

IS_ERROR()

IS_ERROR(mixed  $value = '') : boolean

IS_ERROR

Parameters

mixed $value

Value to check

Returns

boolean

IS_NA()

IS_NA(mixed  $value = '') : boolean

IS_NA

Parameters

mixed $value

Value to check

Returns

boolean

IS_EVEN()

IS_EVEN(mixed  $value = null) : boolean

IS_EVEN

Parameters

mixed $value

Value to check

Returns

boolean

IS_ODD()

IS_ODD(mixed  $value = null) : boolean

IS_ODD

Parameters

mixed $value

Value to check

Returns

boolean

IS_NUMBER()

IS_NUMBER(mixed  $value = null) : boolean

IS_NUMBER

Parameters

mixed $value

Value to check

Returns

boolean

IS_LOGICAL()

IS_LOGICAL(mixed  $value = null) : boolean

IS_LOGICAL

Parameters

mixed $value

Value to check

Returns

boolean

IS_TEXT()

IS_TEXT(mixed  $value = null) : boolean

IS_TEXT

Parameters

mixed $value

Value to check

Returns

boolean

IS_NONTEXT()

IS_NONTEXT(mixed  $value = null) : boolean

IS_NONTEXT

Parameters

mixed $value

Value to check

Returns

boolean

VERSION()

VERSION() : string

VERSION

Returns

string —

Version information

N()

N(  $value = null) : \number

N

Returns a value converted to a number

Parameters

$value

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

TYPE()

TYPE(  $value = null) : \number

TYPE

Returns a number that identifies the type of a value

Parameters

$value

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

flattenArray()

flattenArray(array  $array) : array

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

Parameters

array $array

Array to be flattened

Returns

array —

Flattened array

flattenArrayIndexed()

flattenArrayIndexed(array  $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

Returns

array —

Flattened array

flattenSingleValue()

flattenSingleValue(mixed  $value = '') : mixed

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

Parameters

mixed $value

Array or scalar value

Returns

mixed