In this article:

How to Use DCOUNTA in Google Sheets (Easiest Way in 2024)

May 8, 2024

DCOUNTA in Google Sheets

DCOUNTA is a database function used in spreadsheet programs such as Microsoft Excel and Google Sheets. It counts the non-blank cells in a column of a list or database that match specified conditions, making it particularly useful for managing large data sets. 

Syntax

The syntax for DCOUNTA generally looks like this:

DCOUNTA(database, field, criteria)

  • database: This is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.

  • field: This indicates which column to count. The field argument can be either the label of the column in double quotes (e.g., "Age") or a numeric index that represents the position of the column within the list (e.g., 3 for the third column).

  • criteria: This is the range of cells that contains the conditions you specify. It must include at least one column label and at least one cell below the column label for specifying a condition for the column.

How to Use DCOUNTA in Google Sheets

Follow the steps below to use DCOUNTA in Google Sheets. 

1. Open Google Sheets

Open a new or existing spreadsheet. For our example, we will use a data set that contains information on Employee ID, Name, Department, and Years of Service. Decide on what you want to count. For this example, let's count the number of employees in the Sales department with more than 5 years of service.

dcounta google sheets

2. Create a Criteria Range for Filtering the Data to Count

Create a criteria range on your sheet that includes column labels for "Department" and "Years of Service". Below them, specify "Sales" and ">5" respectively to match our count criteria.

google sheets dcounta

3. Type the DCOUNTA Formula into a Cell Where You Want the Result

Select a cell where you want to display the count and type =DCOUNTA( to begin the formula.

how to use dcounta in google sheets

4. Specify the Entire Range of Your Dataset as the Database Argument in the Formula

For the database argument, select your entire dataset including the column labels. Assuming your data starts in A1, your range might be A1:D11.

5. Choose a Column to Count from by Specifying the Field Argument in the Formula

After the database range, add a comma. Then specify the field to count from. Since we're interested in any non-blank fields and our criteria is based on the "Department" and "Years of Service", you can use any column as your field. For simplicity, use "Employee ID".

6. Define the Criteria Range in the Formula to Filter the Data

Add another comma and select your criteria range. If your criteria range is set up starting at F1, your range might be F1:G2.

7. Complete the Formula and Press Enter to Execute the DCOUNTA Function

Finish your formula with a closing parenthesis and press Enter. Your complete formula might look like =DCOUNTA(A1:D11, "Employee ID", F1:G2).

8. Review the Count Result and Verify It Matches Your Expectations

Examine the count returned by the DCOUNTA function. It tells you how many employees from the Sales department have more than 5 years of service.

9. Adjust the Criteria Range to Explore Different Data Counts as Needed

If you wish to explore different counts, such as a different department or years of service, simply adjust the criteria in your criteria range. The formula will automatically update to reflect the new count.

We hope that you now have a better understanding of what DCOUNTA in Google Sheets is how to use DCOUNTA in Google Sheets. If you enjoyed this article, you might also like our article on whether Google Sheets saves automatically or our article on how to hide tabs in Google Sheets from certain users.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->