Averages
extends AggregateBase
in package
Table of Contents
Methods
- average() : float|int|string
- AVERAGE.
- averageA() : float|int|string
- AVERAGEA.
- averageDeviations() : float|string
- AVEDEV.
- median() : float|string
- MEDIAN.
- mode() : float|string
- MODE.
- filterArguments() : array<string|int, mixed>
- isAcceptedCountable() : bool
- testAcceptedBoolean() : mixed
- MS Excel does not count Booleans if passed as cell values, but they are counted if passed as literals.
- modeCalc() : float|string
- Special variant of array_count_values that isn't limited to strings and integers, but can work with floating point numbers as values.
Methods
average()
AVERAGE.
public
static average(mixed ...$args) : float|int|string
Returns the average (arithmetic mean) of the arguments
Excel Function: AVERAGE(value1[,value2[, ...]])
Parameters
- $args : mixed
-
Data values
Return values
float|int|string —(string if result is an error)
averageA()
AVERAGEA.
public
static averageA(mixed ...$args) : float|int|string
Returns the average of its arguments, including numbers, text, and logical values
Excel Function: AVERAGEA(value1[,value2[, ...]])
Parameters
- $args : mixed
-
Data values
Return values
float|int|string —(string if result is an error)
averageDeviations()
AVEDEV.
public
static averageDeviations(mixed ...$args) : float|string
Returns the average of the absolute deviations of data points from their mean. AVEDEV is a measure of the variability in a data set.
Excel Function: AVEDEV(value1[,value2[, ...]])
Parameters
- $args : mixed
-
Data values
Return values
float|string —(string if result is an error)
median()
MEDIAN.
public
static median(mixed ...$args) : float|string
Returns the median of the given numbers. The median is the number in the middle of a set of numbers.
Excel Function: MEDIAN(value1[,value2[, ...]])
Parameters
- $args : mixed
-
Data values
Return values
float|string —The result, or a string containing an error
mode()
MODE.
public
static mode(mixed ...$args) : float|string
Returns the most frequently occurring, or repetitive, value in an array or range of data
Excel Function: MODE(value1[,value2[, ...]])
Parameters
- $args : mixed
-
Data values
Return values
float|string —The result, or a string containing an error
filterArguments()
protected
static filterArguments(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
Return values
array<string|int, mixed>isAcceptedCountable()
protected
static isAcceptedCountable(mixed $arg, mixed $k[, bool $countNull = false ]) : bool
Parameters
- $arg : mixed
- $k : mixed
- $countNull : bool = false
Return values
booltestAcceptedBoolean()
MS Excel does not count Booleans if passed as cell values, but they are counted if passed as literals.
protected
static testAcceptedBoolean(mixed $arg, mixed $k) : mixed
OpenOffice Calc always counts Booleans. Gnumeric never counts Booleans.
Parameters
- $arg : mixed
- $k : mixed
modeCalc()
Special variant of array_count_values that isn't limited to strings and integers, but can work with floating point numbers as values.
private
static modeCalc(array<string|int, mixed> $data) : float|string
Parameters
- $data : array<string|int, mixed>