Methods

ARABIC()

ARABIC(string  $roman) : int|string

ARABIC.

Converts a Roman numeral to an Arabic numeral.

Excel Function: ARABIC(text)

Parameters

string $roman

Returns

int|string —

the arabic numberal contrived from the roman numeral

ATAN2()

ATAN2(float  $xCoordinate = null, float  $yCoordinate = null) : float|string

ATAN2.

This function calculates the arc tangent of the two variables x and y. It is similar to calculating the arc tangent of y ÷ x, except that the signs of both arguments are used to determine the quadrant of the result. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between -pi and pi, excluding -pi.

Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard PHP atan2() function, so we need to reverse them here before calling the PHP atan() function.

Excel Function: ATAN2(xCoordinate,yCoordinate)

Parameters

float $xCoordinate

the x-coordinate of the point

float $yCoordinate

the y-coordinate of the point

Returns

float|string —

the inverse tangent of the specified x- and y-coordinates, or a string containing an error

BASE()

BASE(float  $number, float  $radix, int  $minLength = null) : string

BASE.

Converts a number into a text representation with the given radix (base).

Excel Function: BASE(Number, Radix [Min_length])

Parameters

float $number
float $radix
int $minLength

Returns

string —

the text representation with the given radix (base)

CEILING()

CEILING(float  $number, float  $significance = null) : float|string

CEILING.

Returns number rounded up, away from zero, to the nearest multiple of significance. For example, if you want to avoid using pennies in your prices and your product is priced at $4.42, use the formula =CEILING(4.42,0.05) to round prices up to the nearest nickel.

Excel Function: CEILING(number[,significance])

Parameters

float $number

the number you want to round

float $significance

the multiple to which you want to round

Returns

float|string —

Rounded Number, or a string containing an error

COMBIN()

COMBIN(int  $numObjs, int  $numInSet) : int|string

COMBIN.

Returns the number of combinations for a given number of items. Use COMBIN to determine the total possible number of groups for a given number of items.

Excel Function: COMBIN(numObjs,numInSet)

Parameters

int $numObjs

Number of different objects

int $numInSet

Number of objects in each combination

Returns

int|string —

Number of combinations, or a string containing an error

EVEN()

EVEN(float  $number) : int|string

EVEN.

Returns number rounded up to the nearest even integer. You can use this function for processing items that come in twos. For example, a packing crate accepts rows of one or two items. The crate is full when the number of items, rounded up to the nearest two, matches the crate's capacity.

Excel Function: EVEN(number)

Parameters

float $number

Number to round

Returns

int|string —

Rounded Number, or a string containing an error

getEven()

getEven(float  $number) : int

Parameters

float $number

Returns

int —

FACT()

FACT(float  $factVal) : int|string

FACT.

Returns the factorial of a number. The factorial of a number is equal to 123*...* number.

Excel Function: FACT(factVal)

Parameters

float $factVal

Factorial Value

Returns

int|string —

Factorial, or a string containing an error

FACTDOUBLE()

FACTDOUBLE(float  $factVal) : int|string

FACTDOUBLE.

Returns the double factorial of a number.

Excel Function: FACTDOUBLE(factVal)

Parameters

float $factVal

Factorial Value

Returns

int|string —

Double Factorial, or a string containing an error

FLOOR()

FLOOR(float  $number, float  $significance = null) : float|string

FLOOR.

Rounds number down, toward zero, to the nearest multiple of significance.

Excel Function: FLOOR(number[,significance])

Parameters

float $number

Number to round

float $significance

Significance

Returns

float|string —

Rounded Number, or a string containing an error

FLOORMATH()

FLOORMATH(float  $number, float  $significance = null, int  $mode) : float|string

FLOOR.MATH.

Round a number down to the nearest integer or to the nearest multiple of significance.

Excel Function: FLOOR.MATH(number[,significance[,mode]])

Parameters

float $number

Number to round

float $significance

Significance

int $mode

direction to round negative numbers

Returns

float|string —

Rounded Number, or a string containing an error

FLOORPRECISE()

FLOORPRECISE(float  $number, float  $significance = 1) : float|string

FLOOR.PRECISE.

Rounds number down, toward zero, to the nearest multiple of significance.

Excel Function: FLOOR.PRECISE(number[,significance])

Parameters

float $number

Number to round

float $significance

Significance

Returns

float|string —

Rounded Number, or a string containing an error

INT()

INT(float  $number) : int|string

INT.

Casts a floating point value to an integer

Excel Function: INT(number)

Parameters

float $number

Number to cast to an integer

Returns

int|string —

Integer value, or a string containing an error

GCD()

GCD(mixed  ...$args) : int|mixed|string

GCD.

Returns the greatest common divisor of a series of numbers. The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder.

Excel Function: GCD(number1[,number2[, ...]])

Parameters

mixed $args variadic

Data values

Returns

int|mixed|string —

Greatest Common Divisor, or a string containing an error

LCM()

LCM(mixed  ...$args) : int|string

LCM.

Returns the lowest common multiplier of a series of numbers The least common multiple is the smallest positive integer that is a multiple of all integer arguments number1, number2, and so on. Use LCM to add fractions with different denominators.

Excel Function: LCM(number1[,number2[, ...]])

Parameters

mixed $args variadic

Data values

Returns

int|string —

Lowest Common Multiplier, or a string containing an error

logBase()

logBase(float  $number = null, float  $base = 10) : float|string

LOG_BASE.

Returns the logarithm of a number to a specified base. The default base is 10.

Excel Function: LOG(number[,base])

Parameters

float $number

The positive real number for which you want the logarithm

float $base

The base of the logarithm. If base is omitted, it is assumed to be 10.

Returns

float|string —

The result, or a string containing an error

MDETERM()

MDETERM(array  $matrixValues) : float|string

MDETERM.

Returns the matrix determinant of an array.

Excel Function: MDETERM(array)

Parameters

array $matrixValues

A matrix of values

Returns

float|string —

The result, or a string containing an error

MINVERSE()

MINVERSE(array  $matrixValues) : array|string

MINVERSE.

Returns the inverse matrix for the matrix stored in an array.

Excel Function: MINVERSE(array)

Parameters

array $matrixValues

A matrix of values

Returns

array|string —

The result, or a string containing an error

MMULT()

MMULT(array  $matrixData1, array  $matrixData2) : array|string

MMULT.

Parameters

array $matrixData1

A matrix of values

array $matrixData2

A matrix of values

Returns

array|string —

The result, or a string containing an error

MOD()

MOD(int  $a = 1, int  $b = 1) : int|string

MOD.

Parameters

int $a

Dividend

int $b

Divisor

Returns

int|string —

Remainder, or a string containing an error

MROUND()

MROUND(float  $number, int  $multiple) : float|string

MROUND.

Rounds a number to the nearest multiple of a specified value

Parameters

float $number

Number to round

int $multiple

Multiple to which you want to round $number

Returns

float|string —

Rounded Number, or a string containing an error

MULTINOMIAL()

MULTINOMIAL(array  ...$args) : float|string

MULTINOMIAL.

Returns the ratio of the factorial of a sum of values to the product of factorials.

Parameters

array $args variadic

An array of mixed values for the Data Series

Returns

float|string —

The result, or a string containing an error

ODD()

ODD(float  $number) : int|string

ODD.

Returns number rounded up to the nearest odd integer.

Parameters

float $number

Number to round

Returns

int|string —

Rounded Number, or a string containing an error

POWER()

POWER(float  $x, float  $y = 2) : float|string

POWER.

Computes x raised to the power y.

Parameters

float $x
float $y

Returns

float|string —

The result, or a string containing an error

PRODUCT()

PRODUCT(mixed  ...$args) : float

PRODUCT.

PRODUCT returns the product of all the values and cells referenced in the argument list.

Excel Function: PRODUCT(value1[,value2[, ...]])

Parameters

mixed $args variadic

Data values

Returns

float —

QUOTIENT()

QUOTIENT(mixed  ...$args) : float

QUOTIENT.

QUOTIENT function returns the integer portion of a division. Numerator is the divided number and denominator is the divisor.

Excel Function: QUOTIENT(value1[,value2[, ...]])

Parameters

mixed $args variadic

Data values

Returns

float —

RAND()

RAND(int  $min, int  $max) : int

RAND.

Parameters

int $min

Minimal value

int $max

Maximal value

Returns

int —

Random number

ROMAN()

ROMAN(mixed  $aValue, mixed  $style) : string

ROMAN.

Converts a number to Roman numeral

Parameters

mixed $aValue

Number to convert

mixed $style

Number indicating one of five possible forms

Returns

string —

Roman numeral, or a string containing an error

ROUNDUP()

ROUNDUP(float  $number, int  $digits) : float|string

ROUNDUP.

Rounds a number up to a specified number of decimal places

Parameters

float $number

Number to round

int $digits

Number of digits to which you want to round $number

Returns

float|string —

Rounded Number, or a string containing an error

ROUNDDOWN()

ROUNDDOWN(float  $number, int  $digits) : float|string

ROUNDDOWN.

Rounds a number down to a specified number of decimal places

Parameters

float $number

Number to round

int $digits

Number of digits to which you want to round $number

Returns

float|string —

Rounded Number, or a string containing an error

SERIESSUM()

SERIESSUM(array  ...$args) : float|string

SERIESSUM.

Returns the sum of a power series

Parameters

array $args variadic

An array of mixed values for the Data Series

Returns

float|string —

The result, or a string containing an error

SIGN()

SIGN(float  $number) : int|string

SIGN.

Determines the sign of a number. Returns 1 if the number is positive, zero (0) if the number is 0, and -1 if the number is negative.

Parameters

float $number

Number to round

Returns

int|string —

sign value, or a string containing an error

returnSign()

returnSign(float  $number) : int

Parameters

float $number

Returns

int —

SQRTPI()

SQRTPI(float  $number) : float|string

SQRTPI.

Returns the square root of (number * pi).

Parameters

float $number

Number

Returns

float|string —

Square Root of Number * Pi, or a string containing an error

SUBTOTAL()

SUBTOTAL(int  $functionType, array  ...$args) : float|string

SUBTOTAL.

Returns a subtotal in a list or database.

Parameters

int $functionType

A number 1 to 11 that specifies which function to use in calculating subtotals within a range list Numbers 101 to 111 shadow the functions of 1 to 11 but ignore any values in the range that are in hidden rows or columns

array $args variadic

A mixed data series of values

Returns

float|string —

SUM()

SUM(mixed  ...$args) : float

SUM.

SUM computes the sum of all the values and cells referenced in the argument list.

Excel Function: SUM(value1[,value2[, ...]])

Parameters

mixed $args variadic

Data values

Returns

float —

SUMIF()

SUMIF(mixed  $range, string  $criteria, mixed  $sumRange = []) : float

SUMIF.

Totals the values of cells that contain numbers within the list of arguments

Excel Function: SUMIF(range, criteria, [sum_range])

Parameters

mixed $range

Data values

string $criteria

the criteria that defines which cells will be summed

mixed $sumRange

Returns

float —

SUMIFS()

SUMIFS(mixed  ...$args) : float

SUMIFS.

Totals the values of cells that contain numbers within the list of arguments

Excel Function: SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Parameters

mixed $args variadic

Data values

Returns

float —

SUMPRODUCT()

SUMPRODUCT(mixed  ...$args) : float|string

SUMPRODUCT.

Excel Function: SUMPRODUCT(value1[,value2[, ...]])

Parameters

mixed $args variadic

Data values

Returns

float|string —

The result, or a string containing an error

SUMSQ()

SUMSQ(mixed  ...$args) : float

SUMSQ.

SUMSQ returns the sum of the squares of the arguments

Excel Function: SUMSQ(value1[,value2[, ...]])

Parameters

mixed $args variadic

Data values

Returns

float —

SUMX2MY2()

SUMX2MY2(array  $matrixData1, array  $matrixData2) : float

SUMX2MY2.

Parameters

array $matrixData1

Matrix #1

array $matrixData2

Matrix #2

Returns

float —

SUMX2PY2()

SUMX2PY2(array  $matrixData1, array  $matrixData2) : float

SUMX2PY2.

Parameters

array $matrixData1

Matrix #1

array $matrixData2

Matrix #2

Returns

float —

SUMXMY2()

SUMXMY2(array  $matrixData1, array  $matrixData2) : float

SUMXMY2.

Parameters

array $matrixData1

Matrix #1

array $matrixData2

Matrix #2

Returns

float —

TRUNC()

TRUNC(float  $value, int  $digits) : float|string

TRUNC.

Truncates value to the number of fractional digits by number_digits.

Parameters

float $value
int $digits

Returns

float|string —

Truncated value, or a string containing an error

SEC()

SEC(float  $angle) : float|string

SEC.

Returns the secant of an angle.

Parameters

float $angle

Number

Returns

float|string —

The secant of the angle

SECH()

SECH(float  $angle) : float|string

SECH.

Returns the hyperbolic secant of an angle.

Parameters

float $angle

Number

Returns

float|string —

The hyperbolic secant of the angle

CSC()

CSC(float  $angle) : float|string

CSC.

Returns the cosecant of an angle.

Parameters

float $angle

Number

Returns

float|string —

The cosecant of the angle

CSCH()

CSCH(float  $angle) : float|string

CSCH.

Returns the hyperbolic cosecant of an angle.

Parameters

float $angle

Number

Returns

float|string —

The hyperbolic cosecant of the angle

COT()

COT(float  $angle) : float|string

COT.

Returns the cotangent of an angle.

Parameters

float $angle

Number

Returns

float|string —

The cotangent of the angle

COTH()

COTH(float  $angle) : float|string

COTH.

Returns the hyperbolic cotangent of an angle.

Parameters

float $angle

Number

Returns

float|string —

The hyperbolic cotangent of the angle

ACOT()

ACOT(float  $number) : float|string

ACOT.

Returns the arccotangent of a number.

Parameters

float $number

Number

Returns

float|string —

The arccotangent of the number

numberOrNan()

numberOrNan(float  $result) : float|string

Return NAN or value depending on argument.

Parameters

float $result

Number

Returns

float|string —

ACOTH()

ACOTH(float  $number) : float|string

ACOTH.

Returns the hyperbolic arccotangent of a number.

Parameters

float $number

Number

Returns

float|string —

The hyperbolic arccotangent of the number

builtinROUND()

builtinROUND(mixed  $number, mixed  $precision) : float|string

ROUND.

Returns the result of builtin function round after validating args.

Parameters

mixed $number

Should be numeric

mixed $precision

Should be int

Returns

float|string —

Rounded number

builtinABS()

builtinABS(mixed  $number) : float|int|string

ABS.

Returns the result of builtin function abs after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|int|string —

Rounded number

builtinACOS()

builtinACOS(mixed  $number) : float|string

ACOS.

Returns the result of builtin function acos after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinACOSH()

builtinACOSH(mixed  $number) : float|string

ACOSH.

Returns the result of builtin function acosh after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinASIN()

builtinASIN(mixed  $number) : float|string

ASIN.

Returns the result of builtin function asin after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinASINH()

builtinASINH(mixed  $number) : float|string

ASINH.

Returns the result of builtin function asinh after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinATAN()

builtinATAN(mixed  $number) : float|string

ASIN.

Returns the result of builtin function atan after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinATANH()

builtinATANH(mixed  $number) : float|string

ATANH.

Returns the result of builtin function atanh after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinCOS()

builtinCOS(mixed  $number) : float|string

COS.

Returns the result of builtin function cos after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinCOSH()

builtinCOSH(mixed  $number) : float|string

COSH.

Returns the result of builtin function cos after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinDEGREES()

builtinDEGREES(mixed  $number) : float|string

DEGREES.

Returns the result of builtin function rad2deg after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinEXP()

builtinEXP(mixed  $number) : float|string

EXP.

Returns the result of builtin function exp after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinLN()

builtinLN(mixed  $number) : float|string

LN.

Returns the result of builtin function log after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinLOG10()

builtinLOG10(mixed  $number) : float|string

LOG10.

Returns the result of builtin function log after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinRADIANS()

builtinRADIANS(mixed  $number) : float|string

RADIANS.

Returns the result of builtin function deg2rad after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinSIN()

builtinSIN(mixed  $number) : float|string

SIN.

Returns the result of builtin function sin after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinSINH()

builtinSINH(mixed  $number) : float|string

SINH.

Returns the result of builtin function sinh after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinSQRT()

builtinSQRT(mixed  $number) : float|string

SQRT.

Returns the result of builtin function sqrt after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinTAN()

builtinTAN(mixed  $number) : float|string

TAN.

Returns the result of builtin function tan after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

builtinTANH()

builtinTANH(mixed  $number) : float|string

TANH.

Returns the result of builtin function sinh after validating args.

Parameters

mixed $number

Should be numeric

Returns

float|string —

Rounded number

nullFalseTrueToNumber()

nullFalseTrueToNumber(mixed  $number) : void

Many functions accept null/false/true argument treated as 0/0/1.

Parameters

mixed $number

calculateArabic()

calculateArabic(array  $roman, int  $sum, int  $subtract) : int

Recursively calculate the arabic value of a roman numeral.

Parameters

array $roman
int $sum
int $subtract

Returns

int —

filterHiddenArgs()

filterHiddenArgs(mixed  $cellReference, mixed  $args) : mixed

Parameters

mixed $cellReference
mixed $args

Returns

mixed —

filterFormulaArgs()

filterFormulaArgs(mixed  $cellReference, mixed  $args) : mixed

Parameters

mixed $cellReference
mixed $args

Returns

mixed —

factors()

factors(mixed  $value) : mixed

Parameters

mixed $value

Returns

mixed —

strSplit()

strSplit(string  $roman) : array

Parameters

string $roman

Returns

array —

evaluateGCD()

evaluateGCD(mixed  $a, mixed  $b) : mixed

Parameters

mixed $a
mixed $b

Returns

mixed —

verySmallDivisor()

verySmallDivisor(float  $number) : bool

Parameters

float $number

Returns

bool —