DCOUNTA Function in Excel: Count Non-Empty Records Matching Criteria

DCOUNTA Function in Excel: Count Non-Empty Records Matching Criteria 1
⏱ 1 min readUpdated 5 October 2026

DatabaseLevel: ExpertAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. DCOUNTA in practice
  5. Where you will use it
  6. Worked example
  7. Mistakes people make
  8. Related functions

DCOUNTA counts non-blank entries in a field for records that meet the criteria; unlike DCOUNT it also counts text. Like all D-functions it uses a database range and a criteria range you can edit on the sheet.

Advertisement

Syntax

=DCOUNTA(database, field, criteria)
Argument What it means
database The table including headers
field Column name in quotes or its number
criteria Range with headers and conditions

Examples

Example 1

=IFERROR(DCOUNTA(DB,"Customer",CHOOSE(A2,CritA,CritB,CritC)),"error "&ERROR.TYPE(DCOUNTA(DB,"Customer",CHOOSE(A2,CritA,CritB,CritC))))

Result: 2. Database H1:J6 (North 12000, South 8000, North 15000, West 22000, South 9000) with three criteria blocks.

DCOUNTA in practice

Where you will use it

  • Reports where users edit the criteria on the sheet
  • OR conditions on separate rows
  • Legacy templates

Worked example

Database H1:J6 (North 12000, South 8000, North 15000, West 22000, South 9000) with three criteria blocks.

CaseCriteriaFormulaResult
1Region = North=IFERROR(DCOUNTA(DB,"Customer",CHOOSE(A2,CritA,CritB,CritC)),"error "&ERROR.TYPE(DCOUNTA(DB,"Customer",CHOOSE(A2,CritA,CritB,CritC))))2
2Sales > 10000=IFERROR(DCOUNTA(DB,"Customer",CHOOSE(A3,CritA,CritB,CritC)),"error "&ERROR.TYPE(DCOUNTA(DB,"Customer",CHOOSE(A3,CritA,CritB,CritC))))3
3North OR South=IFERROR(DCOUNTA(DB,"Customer",CHOOSE(A4,CritA,CritB,CritC)),"error "&ERROR.TYPE(DCOUNTA(DB,"Customer",CHOOSE(A4,CritA,CritB,CritC))))4

Results calculated in Excel.

Mistakes people make

MistakeWhat to do instead
Criteria headers that don't matchHeaders must match the database exactly
One matching record for D-SD/VARSample versions need 2+ records (#DIV/0!)

DSUM · DAVERAGE · DCOUNT

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

Advertisement
✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong