Google Sheets COUNTIF Function: Syntax, Examples & Tips

The COUNTIF function counts the number of cells that meet a specified condition within a given range.
Google Sheets
COUNTIF(range, criterion)

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is a COUNTIF?
  3. A Practical Example
  4. COUNTIF Formula
  5. Result of the Formula
  6. Why Use COUNTIF?
  7. Key Takeaways:
  8. Example use case

Parameters

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.

What is a COUNTIF?

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.

A Practical Example

Imagine you are tracking the sales performance of different products in a Google Sheets document:

Sales Data Table:

ProductNameSales
Widget A10
Widget B15
Widget A20
Widget C5
Widget B10

You want to find out how many times Widget A was sold.

COUNTIF Formula

To achieve this, you would use the COUNTIF function as follows:

Google Sheets
=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.

Result of the Formula

When you apply the COUNTIF formula to the Sales Data Table, the output would be:

ProductNameSalesCount of Widget A
Widget A102
Widget B15
Widget A20
Widget C5
Widget B10

In this case, the COUNTIF function would return 2, indicating that Widget A appears twice in the ProductName column.

Why Use COUNTIF?

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.

Key Takeaways:

  • COUNTIF: A Google Sheets function that counts the number of cells that meet a specific condition.
  • Simplicity: Provides an easy way to quantify data without manual counting.
  • Versatile: Can be used for various types of data analysis, from sales tracking to survey results.
  • Common Use Cases: Ideal for inventory management, performance tracking, and any scenario where counting specific data points is necessary.

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!

Example use case

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.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.