The DCOUNT function in Excel performs the count of the cells that have numbers in its field or column or have a database that matches conditions specified by you.
What is a DCOUNT function in Excel?
The DCOUNT function in Excel counts the matching records of a database according to given criteria. The DCOUNT function will count the numeric values of the fields.
How the DCOUNT function is used in Excel?
It is simple to use as the user have to provide a field argument, and it is even optional. There are three arguments used in the DCOUNT function. To use the DCOUNT function, follow the Example section.
Formula or Syntax
Parameters or Arguments of a DCOUNT function
The arguments passed in the DCOUNT function includes:
- Database: Required. The database range is defined in the argument including headers.
- Field: Optional. The field name or field index argument is passed if the users want to. Otherwise, it can be left empty.
- Criteria: Required. The Criteria range is specified in this argument along with the headers.
Let us consider an example to understand the workings of the DCOUNT function:
- At first, make a sheet of pens of different colors and prices. The price of the pens varies with time. The list contains the price of one pen, the quality bought, and the total price.
Figure 1. Make a table of the database, filed, and criteria
- Now, once you have specified the field’s value, select the cell for the DCOUNT function. And insert the DCOUNT function. You will have to provide the database value, the field value, and the criteria value in the window.
Figure 2. Enter the database, field, and criteria argument value
- Tap on the OK button and the function will give you the value of the DCOUNT function in the specified cell.
Figure 3. The output of the DCOUNT function
If the arguments specified are not valid, then the function will give #VALUE! Error.
Figure 4. Error if the arguments are not valid
Note on the usage of DCOUNT function
The essential notes on usage are listed as:
- The database argument is the range of cells.
- In the field section, the name or index of the field is passed whose value is to be counted.
- In the Criteria field, you can use any range as long as there is at least one column label and one cell in it.
- The database and the criteria field must match the headers.
- Enter a blank line below the Column labels in the criteria ranges to perform an operation on an entire column of the database.
Still need some help with Excel formatting or have other questions about Excel? Connect with a live Excel expert here for some 1 on 1 help. Your first session is always free.