How to Use Excel's DCount Function

Excel's DCOUNT function is short for "database count." It considers all of the cells in a column of a database that match the specified criteria. DCOUNT then returns a count of all cells that contain a numeric value in the same manner as COUNT, the equivalent non-database function. The following steps demonstrate how to use Excel's DCOUNT function.

Instructions

    • 1

      Learn the syntax of DCOUNT. It is DCOUNT(database_array,field,criteria_array). Database is an array that defines the database, field is a column name or number within that database that DCOUNT will count if the cell contains a numeric value and criteria is an array containing the criteria to be used in selecting the rows for DCOUNT to consider.

    • 2

      Study the cell values that will be counted by DCOUNT. Values that are dates, numbers or references to these values will be counted. Error values will not be counted nor will any text that does not resolve to a number.

    • 3

      Use the DCOUNTA function if you want to count error values, logical values or text.

    • 4

      Enter the following in the first four columns of an Excel spreadsheet:

      Row 1: Tree, Height, Age and Yield;
      Row 2: ="=Apple" and =">10" (nothing in columns three and four);
      Row 3: ="=Pear" (nothing in columns two, three and four);
      Row 4: Tree, Height, Age and Yield;
      Row 5: Apple, 18, 20 and none;
      Row 6: Pear, 12, 12 and 10;
      Row 7: Cherry, 13, 14 and none;
      Row 8: Apple, 14, 15 and 10;
      Row 9: Pear, 9, 8 and 8;
      Row 10: Apple, 8, 9 and 6.

    • 5

      Interpret the formula =DCOUNT(A4:D10,"Yield",A1:B2) as follows: The database is defined as the array A4:D10. Note the column names in the first row of this array. "Yield" is the column name from which values will be counted. The criteria are given by A1:B2, which indicates that the column named Tree must contain "Apple" or "Pear" and the column named Height must contain a value greater than 10. DCOUNT(A4:D10,"Yield",A1:B2) will therefore consider the following two records and return 1: Apple, 18, 20, none; and Pear, 12, 12, 10.

Related Searches:

Comments

You May Also Like

Related Ads

Featured