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)
Follow the steps below to use DCOUNTA in 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.
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.
Select a cell where you want to display the count and type =DCOUNTA( to begin 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.
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".
Add another comma and select your criteria range. If your criteria range is set up starting at F1, your range might be F1:G2.
Finish your formula with a closing parenthesis and press Enter. Your complete formula might look like =DCOUNTA(A1:D11, "Employee ID", F1:G2).
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.
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.