PHPExcel_Calculation_Database

category PHPExcel
package PHPExcel_Calculation
copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)

 Methods

DAVERAGE

DAVERAGE(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Averages the values in a column of a list or database that match conditions you specify.

Excel Function: DAVERAGE(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DCOUNT

DCOUNT(mixed[] $database, string | integer $field, mixed[] $criteria) : integer
Static

Counts the cells that contain numbers in a column of a list or database that match conditions that you specify.

Excel Function: DCOUNT(database,[field],criteria)

Excel Function: DAVERAGE(database,field,criteria)

access public
category Database Functions
TODO The field argument is optional. If field is omitted, DCOUNT counts all records in the database that match the criteria.

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

integer

DCOUNTA

DCOUNTA(mixed[] $database, string | integer $field, mixed[] $criteria) : integer
Static

Counts the nonblank cells in a column of a list or database that match conditions that you specify.

Excel Function: DCOUNTA(database,[field],criteria)

access public
category Database Functions
TODO The field argument is optional. If field is omitted, DCOUNTA counts all records in the database that match the criteria.

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

integer

DGET

DGET(mixed[] $database, string | integer $field, mixed[] $criteria) : mixed
Static

Extracts a single value from a column of a list or database that matches conditions that you specify.

Excel Function: DGET(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

mixed

DMAX

DMAX(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Returns the largest number in a column of a list or database that matches conditions you that specify.

Excel Function: DMAX(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DMIN

DMIN(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Returns the smallest number in a column of a list or database that matches conditions you that specify.

Excel Function: DMIN(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DPRODUCT

DPRODUCT(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Multiplies the values in a column of a list or database that match conditions that you specify.

Excel Function: DPRODUCT(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DSTDEV

DSTDEV(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Estimates the standard deviation of a population based on a sample by using the numbers in a column of a list or database that match conditions that you specify.

Excel Function: DSTDEV(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DSTDEVP

DSTDEVP(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Calculates the standard deviation of a population based on the entire population by using the numbers in a column of a list or database that match conditions that you specify.

Excel Function: DSTDEVP(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DSUM

DSUM(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Adds the numbers in a column of a list or database that match conditions that you specify.

Excel Function: DSUM(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DVAR

DVAR(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Estimates the variance of a population based on a sample by using the numbers in a column of a list or database that match conditions that you specify.

Excel Function: DVAR(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

DVARP

DVARP(mixed[] $database, string | integer $field, mixed[] $criteria) : float
Static

Calculates the variance of a population based on the entire population by using the numbers in a column of a list or database that match conditions that you specify.

Excel Function: DVARP(database,field,criteria)

access public
category Database Functions

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

stringinteger

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

float

__fieldExtract

__fieldExtract(mixed[] $database, mixed $field) : string | NULL
Static

Extracts the column ID to use for the data field.

access private

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$field

mixed

Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.

Returns

stringNULL

__filter

__filter(mixed[] $database, mixed[] $criteria) : array
Static

Parses the selection criteria, extracts the database rows that match those criteria, and returns that subset of rows.

access private

Parameters

$database

mixed[]

The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

$criteria

mixed[]

The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

Returns

arrayof mixed