Whole document tree
    

Whole document tree

DCOUNT

DCOUNT

Name

DCOUNT -- 

Description

DCOUNT function counts the cells that contain numbers in a database that match conditions specified.

@database is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

@field specifies which column is used in the function. If @field is an integer, for example. 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in @database range.

@criteria is the range of cells which contains the specified conditions. The first row of a @criteria should contain the labels of the fields for which the criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in @criteria specifies a separate condition, i.e. if a row in @database matches with one of the rows in @criteria then that row is counted in (technically speaking boolean OR between the rows in @criteria). If @criteria specifies more than one columns then each of the conditions in these columns should be true that the row in @database matches (again technically speaking boolean AND between the columns in each row in @criteria).

Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

Examples

DCOUNT(A1:C7, "Salary", A9:A11) equals 3.

DCOUNT(A1:C7, "Salary", A9:B11) equals 2.

DCOUNT(A1:C7, "Name", A9:B11) equals 0.

See also

DAVERAGE.