DCOUNTA in Google Sheets: Count Selected Ticket References Including Text
Use DCOUNTA in Google Sheets to count text and numeric references under AND and OR criteria, with a practical duplicate-record warning.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: DCOUNTA counts entries, including text, in a chosen column after filtering a header-based table. In the worked dataset below, =DCOUNTA(A1:D7,"Reference",H1:H2) returns 3 using the first criteria setup.
Verification: These are documentation-based expectations and independently calculated examples, not results observed in Google Sheets. No native test or application screenshot is available.
When to use DCOUNTA
A support export stores some references as text and others as numbers. Count references for selected tickets without losing the text identifiers. Every Reference cell in this exercise contains a deliberate value. The criteria cells stay visible beside the report so another person can inspect which records were intended to contribute.
Syntax and arguments
=DCOUNTA(database, field, criteria)
database: the complete rectangular range, including its field headers.field: the header of the column to aggregate, or its one-based position inside that range.criteria: a separate range with field headers and one or more rows of tests.
All examples explicitly supply all three arguments. Google’s database specification establishes the header grid: conditions on one row combine with AND; alternative rows combine with OR. Despite the phrase “SQL-like” in some help descriptions, pass a criteria range rather than a SQL statement.
Set up the practice sheet
Use a blank sheet. Enter the following original practice data in A1:D7, Copy only the four field columns; the leftmost Row column is a worksheet-row annotation, not data to enter. The numbered row 1 supplies A1:D1. The table heading above it repeats the field names only for readability; do not enter that display heading as an additional row. Enter numbers as numbers, without units appended. Keep the criteria and result outside this database range.
| Row | Ticket | Queue | State | Reference |
|---|---|---|---|---|
| 1 | Ticket | Queue | State | Reference |
| 2 | T1 | Open | CASE-A | |
| 3 | T2 | Chat | Open | 7102 |
| 4 | T3 | Closed | CASE-C | |
| 5 | T4 | Open | CASE-D | |
| 6 | T5 | Chat | Closed | 7105 |
| 7 | T6 | Phone | Open | CASE-A |
Use F2 for the result. The field argument will be "Reference", which selects column D. The equivalent index is 4, measured from A within A1:D7. Criteria may test other columns without changing which field supplies the result.
First calculation
Clear H1:J4 before each setup so old criteria do not remain. Enter this grid, beginning at H1:
| Cell row | H |
|---|---|
| 1 | Queue |
| 2 | Email |
Enter =DCOUNTA(A1:D7,"Reference",H1:H2) in F2. Expected result: 3.
Matched worksheet rows: 2, 4, 5. Their selected Reference entries are CASE-A, CASE-C, CASE-D. Check the explicit field index by replacing the formula with =DCOUNTA(A1:D7,4,H1:H2); the expected result remains 3.
Require both conditions
Clear H1:J4 before each setup so old criteria do not remain. Enter this grid, beginning at H1:
| Cell row | H | I |
|---|---|---|
| 1 | Queue |
State |
| 2 | Email |
Open |
Enter =DCOUNTA(A1:D7,"Reference",H1:I2) in F2. Expected result: 2.
Matched worksheet rows: 2, 5. Their selected Reference entries are CASE-A, CASE-D. Both tests are on the same criteria row, so a record must pass both. Moving a test to another row would change the selection logic.
Allow either group
Clear H1:J4 before each setup so old criteria do not remain. Enter this grid, beginning at H1:
| Cell row | H | I |
|---|---|---|
| 1 | Queue |
State |
| 2 | Email |
Open |
| 3 | Chat |
Closed |
Enter =DCOUNTA(A1:D7,"Reference",H1:I3) in F2. Expected result: 3.
Matched worksheet rows: 2, 5, 6. Their selected Reference entries are CASE-A, CASE-D, 7105. Each criteria row is a complete alternative. A record qualifies when it passes all tests in either row; it need not pass both alternatives.
Distinguish ticket count from unique-reference count
Clear H1:J4 before each setup so old criteria do not remain. Enter this grid, beginning at H1:
| Cell row | H |
|---|---|
| 1 | State |
| 2 | Open |
Enter =DCOUNTA(A1:D7,"Reference",H1:H2) in F2. Expected result: 4.
Matched worksheet rows: 2, 3, 5, 7. Their selected Reference entries are CASE-A, 7102, CASE-D, CASE-A. The open-ticket filter selects CASE-A, 7102, CASE-D and CASE-A. DCOUNTA counts four selected entries even though only three distinct references appear. That is appropriate for counting ticket records, but not for a unique-customer report. The repeated CASE-A represents two records; no deduplication is requested by this function.
Troubleshooting and interpretation
Do not replace DCOUNTA with a numeric-only count when identifiers include letters. Conversely, a duplicate reference is still an entry. Empty cells, formulas returning empty text, and errors are outside this example; do not infer their treatment from the four-entry result.
If the result is unexpected, first list the records selected by each criteria row. Then check the aggregation separately. This distinguishes an incorrect filter from incorrect arithmetic.
- Keep A1:D7 inclusive of the header. Starting at A2 turns the first record into the apparent labels.
- Copy criteria headers from row 1 rather than inventing display labels. Check that
"Reference"names the intended result field. - Enter comparison criteria such as
>=7as cell contents, not as a SQL fragment or an extra formula argument. - Keep the database range large enough for new records, but do not silently include unrelated totals below the register.
- If a formula fails to parse, check quotation marks, the leading equals sign, and the argument separator expected by your sheet. The examples use English function names and comma-separated arguments.
- If the filter matches no rows, inspect the filter before interpreting any output. This guide does not prescribe an error code or default for empty selections.
Compatibility and verification limits
This guide targets Google Sheets as described in the saved official documentation reviewed October 19, 2026. The reviewed sources do not provide a first-supported version or a desktop-style release matrix. No mobile, offline, exported Excel, or other spreadsheet-engine behavior was tested. Recheck the worked records after importing or exporting a workbook.
The examples deliberately avoid wildcard rules, date-text parsing, formulas returning empty text, and errors in the selected field. Those edge cases are not established by the sources reviewed here. Do not borrow another product’s behavior for them. For production reports, test the exact data types and selection boundaries used in your own sheet.
Official references
- Google DCOUNTA reference: function purpose and three-argument signature, reviewed from the saved first-party snapshot.
- Google database functions: field selection, criteria headers, AND/OR logic, repeated headers and unrestricted empty criteria cells.
All datasets, record selections and applications above are original instructional examples.