Excel: Using DCOUNT to Count Occurrences of Text in a Database

Last reviewed: November 2, 1994
Article ID: Q26441

SUMMARY

In Microsoft Excel, the DCOUNT function normally counts the occurrence of numbers in a particular field of a database for all records that satisfy a set of criteria. It is also possible to count the occurrence of text in a field.

Text in a database field can be counted by omitting the "field" argument. For example, to count numbers in the field titled "Amount" according to a specific criteria, the DCOUNT function should appear as follows:

   =DCOUNT(Database,"Amount",Criteria)

However, to count records that match the criteria, even if the fields in those records do not contain numbers, the function should be written as follows:

   =DCOUNT(Database,,Criteria)


KBCategory: kbother
KBSubcategory:

Additional reference words: 1.00 1.03 1.04 1.06 1.50 2.20 3.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.