In this article:

How to Use DCOUNTA in Google Sheets (Easiest Way in 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. 


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.

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
Creates a one- or multiple-day calendar event with optional attendees
Adds an object to Hubspot
Create a Slack channel, and optionally add a topic or members
Makes any HTTP request
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
Makes any HTTP request and returns the response
Inserts given array below defined values in given worksheet
Sends an email using your Google account
Sends an email using your Microsoft Outlook account
Sends a Slack message
Sends an SMS message using your Twilio account
Updates cells with given values
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started