DCOUNT Function

Basic Description

The Excel Dcount function returns the number of cells containing numbers, in a field (column) of a database for selected records only. The records to be included in the count are those that satisfy a set of one or more user-specified criteria. The function is very similar to the Excel Countifs function, which was introduced as a new function in Excel 2007.

Syntax: DCOUNT( database, [field], criteria )

where the arguments are shown in the table below:

database A range of cells containing the database. The top row of the database should specify the field names.

An optional argument which specifies the field (column) within the database for which you want to return the count.

This can either be a field number, or can be the field name (ie. the header in the top row of the database) encased in quotes (eg. “Gender”, “Subject”, etc)

If the [field] argument is omitted, the Dcount function simply returns the count of all records that satisfy the supplied criteria.


A range of cells that contain the criteria, to specify which records should be included in the calculation.

The range can include one or more criteria, which are presented as a field name in one cell and the condition for that field in the cell below.


Subject Age
Math >8

Note that the Excel database functions are not case sensitive. So, for example, the criteria =”Male” will be satisfied by cells containing the text “Male” or “male”.


Excel Dcount Function Examples

1 Name Gender Age Subject Score
2 Manjura Female 8 Math 63%
3 Momtaz Female 8 English 78%
4 Sharmin Female 8 Science 39%
5 Monower Male 8 Math 55%
6 Mostofa Male 8 English 71%
7 Sumon Male 8 Science awaiting
8 Mustaniba Female 9 Math
9 Sumona Female 9 English 52%
10 Monowara Female 9 Science 48%
11 Moslem Male 9 Math 78%
12 Azwad Male 9 English 69%
13 Arifin Male 9 Science 65%

The following examples are based on the simple database on the right, which stores the examination marks scored by four children in three different subjects.


Example 1

The example below uses the Dcount function to count the number of Science examination scores recorded for male students. The criteria are specified in cells G1 – H2 and the Dcount formula is shown in cell G3:

1 Subject Gender
2 Science Male
3 =DCOUNT( A1:E13, “Score”, G1:H2 )


The above Dcount function finds that there are 2 rows for which the Gender is “Male” and the Subject is “Science”. However, only one of these rows (row 13) contains a number in the “Score” column. Therefore, the function returns the value 1

Note that, in the above example, the Dcount function has excluded cell E7 from the count, because this cell contains text, and not a number. (However, this cell would have been counted if the Dcounta function had been used instead of the Dcount function).


Example 2

In the example below, the Dcount function is used to find the number of Math examination scores recorded for females.

1 Subject Gender
2 Math Female
3 =DCOUNT( A1:E13, “Score”, G1:H2 )


The above Dcount function finds two rows in which the Subject is “Math” and the Gender is “Female”. However, as cell E8 is blank, the functions only counts cell E2. Therefore the functions returns the value 1

Note that, in the above two examples, instead of typing in “Score” for the Field argument, we could have simply used the number 5 (to denote the 5th column of the database).


Example 3

In the example below, the Dcount function is used to find the number of English examination scores that are higher than 60%.

In this case, the Field argument is omitted, so the Dcount function simply counts all rows satisfying the supplied criteria:

1 Subject Score
2 English >60%
3 =DCOUNT( A1:E13,   , G1:H2 )


The above Dcount function finds three rows for which the Subject is “English” and the Score is greater than 60%. The function therefore returns the count 3

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



clearPost Comment