Excel DCOUNT Function
If you want to follow along with this tutorial, please download the example spreadsheet.
Description
The DCOUNT function counts the cells that contain numbers in a field of records in a databased which match the specified criteria.
Syntax and arguments
Formula syntax
Arguments
|
Return Value
The DCOUNT function returns a numeric value.
Remarks
1. You should better not place the criteria below the database, otherwise, adding new information to database will be inconvenient.
2. If you want to count the number of all items in the column of the database, leave a blank row under column label in the criteria range.
3. There can be multiple rows in the criteria range, the criteria in each row are joined with OR logic, the criteria in the same row are joined with AND logic.
4. If the field contains text or blank value, the cell will not be counted. If you want to count either of numbers and texts in the field, using DCOUNTA function.
5. The database and criteria must have matched column labels.
6. DCOUNT supports wildcard in criteria, but it is not used as good as modern functions, please test carefully.
7. Default, the function is case insensitive.
Version
Excel 2003 or later
Usage and Examples
Example 1 one row criteria-AND logic
Supposing the database is in range B8:E16, the criteria are listed in range B4:E5, now to count the number of cells contain numbers based on the criteria, please use one of below formulas:
=DCOUNT(B8:E16,4,B4:E5) //take the forth column in the database as field
=DCOUNT(B8:E16,,B4:E5) //field is blank
=DCOUNT(B8:E16,"sale",B4:E5) //field is the column named sale
Press Enter key to get the result.
Example 2 two or more row criteria-OR logic
Supposing the database is in range B9:E17, the criteria are listed in range B4:E6, now to count the number of cells contain numbers based on the criteria, please use one of below formulas:
=DCOUNT(B9:E17,4,B4:E6) //take the forth column in the database as field
=DCOUNT(B9:E17,,B4:E6) //field is blank
=DCOUNT(B9:E17,"sale",B4:E6) //field is the column named sale
Press Enter key to get the result.
Example 3 using wildcard in criteria
Supposing the database is in range B8:E16, to count number of items whose name start with “a” Product, please enter *a under Product label in the criteria range, then use formula, see screenshot:
Relative Functions:
Excel DAVERAGE Function
The Excel DAEVARAGE function returns the average of values in a field of records in a list or database that match the specific criteria.
Excel DCOUNTA Function
The DCOUNTA function counts the cells that in a field of records in a databased which match the specified criteria.
Excel DGET Function
The DGET function counts the cells that in a field of records in a databased which match the specified criteria.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.