Excel DCOUNT Function

Using the Excel DCOUNT Function


The Excel DCOUNT function counts the cells that contain numbers in a field, or column, of records in a list or database that match user specified conditions.

To count numbers or text in a given field use the DCOUNTA function.


=DCOUNT (database, field, criteria)

Syntax Breakdown

Required. A range of cells that make up the list or database. The first row of most lists and databases contains labels for each column.

Optional. Which column should be used in the function. The column label should be enclosed in double quotation marks, for example "Color" or "Make", or a number, without quotation marks, that represents the position of the column. For example, 1 for the first column and 5 for the fifth column.

When this argument is provided in the DCOUNT function, it is only counted when cells are non-blank and numeric. If the field argument contains text or is blank it will not be counted, even if it matches the criteria.

Required. Range of cells containing user specified criteria. The criteria range must include at least one column label and one cell below the column label.

Criteria is able to accept more than one row below the column label. When more than one row is used, the function joins each row with OR logic, and the expressions in a given criteria row are joined with AND logic.

Criteria supports the use of wildcard characters, such as the question mark (?) and asterisk (*). The function also handles expressions such as <, >, and <>.

A word of caution with wildcards: it appears as if support is not as extensive as with other functions, like SUMIFS, that accept wildcards. If you use wildcards, be sure to test and verify that the output is what you would expect.

Usage Notes

DCOUNT counts matching values in a database using specific criteria and field.

The function only counts numeric values. Use DCOUNTA to count numbers and text.

The database argument is a range, or list, of cells that includes column headers. Field is the name, or index of the field, to get the value(s) from. Criteria is a range of cells with headers that match those in the database argument.