class PHPExcel_Calculation_MathTrig

PHPExcelCalculationMathTrig

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

Methods

static float
ATAN2(float $xCoordinate = null, float $yCoordinate = null)

ATAN2

static float
CEILING(float $number, float $significance = null)

CEILING

static int
COMBIN(int $numObjs, int $numInSet)

COMBIN

static int
EVEN(float $number)

EVEN

static int
FACT(float $factVal)

FACT

static int
FACTDOUBLE(float $factVal)

FACTDOUBLE

static float
FLOOR(float $number, float $significance = null)

FLOOR

static integer
GCD()

GCD

static integer
INT(float $number)

INT

static int
LCM()

LCM

static float
LOG_BASE(float $number = null, float $base = 10)

LOG_BASE

static float
MDETERM(array $matrixValues)

MDETERM

static array
MINVERSE(array $matrixValues)

MINVERSE

static array
MMULT(array $matrixData1, array $matrixData2)

MMULT

static int
MOD(int $a = 1, int $b = 1)

MOD

static float
MROUND(float $number, int $multiple)

MROUND

static float
MULTINOMIAL()

MULTINOMIAL

static int
ODD(float $number)

ODD

static float
POWER(float $x, float $y = 2)

POWER

static float
PRODUCT()

PRODUCT

static float
QUOTIENT()

QUOTIENT

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

RAND

static 
ROMAN($aValue, $style)

No description

static float
ROUNDUP(float $number, int $digits)

ROUNDUP

static float
ROUNDDOWN(float $number, int $digits)

ROUNDDOWN

static float
SERIESSUM()

SERIESSUM

static int
SIGN(float $number)

SIGN

static float
SQRTPI(float $number)

SQRTPI

static float
SUBTOTAL()

SUBTOTAL

static float
SUM()

SUM

static float
SUMIF($aArgs, $condition, $sumArgs = array())

SUMIF

static float
SUMIFS()

SUMIFS

static float
SUMPRODUCT()

SUMPRODUCT

static float
SUMSQ()

SUMSQ

static float
SUMX2MY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2MY2

static float
SUMX2PY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2PY2

static float
SUMXMY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMXMY2

static float
TRUNC(float $value, int $digits)

TRUNC

Details

at line 113
static float ATAN2(float $xCoordinate = null, float $yCoordinate = null)

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.

Return Value

float The inverse tangent of the specified x- and y-coordinates.

at line 153
static float CEILING(float $number, float $significance = null)

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.

Return Value

float Rounded Number

at line 191
static int COMBIN(int $numObjs, int $numInSet)

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

Return Value

int Number of combinations

at line 225
static int EVEN(float $number)

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

Return Value

int Rounded Number

at line 257
static int FACT(float $factVal)

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

Return Value

int Factorial

at line 295
static int FACTDOUBLE(float $factVal)

FACTDOUBLE

Returns the double factorial of a number.

Excel Function: FACTDOUBLE(factVal)

Parameters

float $factVal Factorial Value

Return Value

int Double Factorial

at line 329
static float FLOOR(float $number, float $significance = null)

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

Return Value

float Rounded Number

at line 370
static integer GCD()

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[, ...]])

Return Value

integer Greatest Common Divisor

at line 445
static integer INT(float $number)

INT

Casts a floating point value to an integer

Excel Function: INT(number)

Parameters

float $number Number to cast to an integer

Return Value

integer Integer value

at line 477
static int LCM()

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[, ...]])

Return Value

int Lowest Common Multiplier

at line 528
static float LOG_BASE(float $number = null, float $base = 10)

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.

Return Value

float

at line 556
static float MDETERM(array $matrixValues)

MDETERM

Returns the matrix determinant of an array.

Excel Function: MDETERM(array)

Parameters

array $matrixValues A matrix of values

Return Value

float

at line 607
static array MINVERSE(array $matrixValues)

MINVERSE

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

Excel Function: MINVERSE(array)

Parameters

array $matrixValues A matrix of values

Return Value

array

at line 652
static array MMULT(array $matrixData1, array $matrixData2)

MMULT

Parameters

array $matrixData1 A matrix of values
array $matrixData2 A matrix of values

Return Value

array

at line 715
static int MOD(int $a = 1, int $b = 1)

MOD

Parameters

int $a Dividend
int $b Divisor

Return Value

int Remainder

at line 741
static float MROUND(float $number, int $multiple)

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

Return Value

float Rounded Number

at line 768
static float MULTINOMIAL()

MULTINOMIAL

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

Return Value

float

at line 803
static int ODD(float $number)

ODD

Returns number rounded up to the nearest odd integer.

Parameters

float $number Number to round

Return Value

int Rounded Number

at line 837
static float POWER(float $x, float $y = 2)

POWER

Computes x raised to the power y.

Parameters

float $x
float $y

Return Value

float

at line 868
static float PRODUCT()

PRODUCT

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

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

Return Value

float

at line 907
static float QUOTIENT()

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[, ...]])

Return Value

float

at line 940
static int RAND(int $min, int $max)

RAND

Parameters

int $min Minimal value
int $max Maximal value

Return Value

int Random number

at line 953
static ROMAN($aValue, $style)

Parameters

$aValue
$style

at line 995
static float ROUNDUP(float $number, int $digits)

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

Return Value

float Rounded Number

at line 1021
static float ROUNDDOWN(float $number, int $digits)

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

Return Value

float Rounded Number

at line 1049
static float SERIESSUM()

SERIESSUM

Returns the sum of a power series

Return Value

float

at line 1086
static int SIGN(float $number)

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

Return Value

int sign value

at line 1111
static float SQRTPI(float $number)

SQRTPI

Returns the square root of (number * pi).

Parameters

float $number Number

Return Value

float Square Root of Number * Pi

at line 1135
static float SUBTOTAL()

SUBTOTAL

Returns a subtotal in a list or database.

Return Value

float

at line 1185
static float SUM()

SUM

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

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

Return Value

float

at line 1215
static float SUMIF($aArgs, $condition, $sumArgs = array())

SUMIF

Counts the number of cells that contain numbers within the list of arguments

Excel Function: SUMIF(value1[,value2[, ...]],condition)

Parameters

$aArgs
$condition
$sumArgs

Return Value

float

at line 1257
static float SUMIFS()

SUMIFS

Counts the number of cells that contain numbers within the list of arguments

Excel Function: SUMIFS(value1[,value2[, ...]],condition)

Return Value

float

at line 1314
static float SUMPRODUCT()

SUMPRODUCT

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

Return Value

float

at line 1359
static float SUMSQ()

SUMSQ

SUMSQ returns the sum of the squares of the arguments

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

Return Value

float

at line 1382
static float SUMX2MY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2MY2

Parameters

mixed[] $matrixData1 Matrix #1
mixed[] $matrixData2 Matrix #2

Return Value

float

at line 1407
static float SUMX2PY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2PY2

Parameters

mixed[] $matrixData1 Matrix #1
mixed[] $matrixData2 Matrix #2

Return Value

float

at line 1432
static float SUMXMY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMXMY2

Parameters

mixed[] $matrixData1 Matrix #1
mixed[] $matrixData2 Matrix #2

Return Value

float

at line 1459
static float TRUNC(float $value, int $digits)

TRUNC

Truncates value to the number of fractional digits by number_digits.

Parameters

float $value
int $digits

Return Value

float Truncated value