COUNTIF(range, criterion)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
range:
The range of cells that you want to evaluate for the specified criterion.
criterion:
The condition or value that you want to count occurrences of within the specified range. This can be a number, text, expression, or a cell reference that defines which cells will be counted.
The COUNTIF function in Google Sheets is a useful tool that allows you to count the number of cells within a range that meet a specific condition or criterion. This function is particularly helpful for analyzing data sets, as it enables you to quickly determine how many entries match a given criterion without having to manually sift through the data.
In simpler terms, COUNTIF helps you quantify data based on specific conditions, making it easier to analyze trends and patterns in your data.
Imagine you are tracking the sales performance of different products in a Google Sheets document:
| ProductName | Sales |
|---|---|
| Widget A | 10 |
| Widget B | 15 |
| Widget A | 20 |
| Widget C | 5 |
| Widget B | 10 |
You want to find out how many times Widget A was sold.
To achieve this, you would use the COUNTIF function as follows:
=COUNTIF(A2:A6, "Widget A")In this formula:
A2:A6 is the range where the function will look for the ProductName."Widget A" is the criterion that the function will use to count the occurrences.When you apply the COUNTIF formula to the Sales Data Table, the output would be:
| ProductName | Sales | Count of Widget A |
|---|---|---|
| Widget A | 10 | 2 |
| Widget B | 15 | |
| Widget A | 20 | |
| Widget C | 5 | |
| Widget B | 10 |
In this case, the COUNTIF function would return 2, indicating that Widget A appears twice in the ProductName column.
COUNTIF is beneficial because it simplifies the process of counting specific entries in your data. It allows you to quickly analyze data trends and make informed decisions based on the results. Additionally, it can be combined with other functions for more complex data analysis.
COUNTIF is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data analysis and reporting capabilities.
Happy spreadsheeting!
You have a sales report where Column A lists product names and Column B shows the number of units sold. You can use COUNTIF to count how many times a specific product was sold, enabling quick analysis of sales performance for targeted marketing strategies.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.