countifs function

COUNTIFS Function Guide: How to Count with Multiple Criteria in Excel and Google Sheets

If you’ve ever needed to count rows that meet more than one condition—such as sales made by a specific rep in a certain region during a given month—the COUNTIFS function is exactly what you’re looking for. COUNTIFS is one of the most practical and frequently used functions in both Excel and Google Sheets, especially for reporting, dashboards, and data analysis templates. In this guide, you’ll learn what COUNTIFS does, how it works, when to use it instead of COUNTIF, and how to avoid the most common mistakes people make when working with multiple criteria.

What Is the COUNTIFS Function and Why Is It Useful?

COUNTIFS counts the number of cells that meet two or more criteria across one or more ranges. Unlike COUNTIF, which is limited to a single condition, COUNTIFS lets you combine multiple logical tests using AND logic. This makes it ideal for real-world data, where you rarely filter by just one thing.

For example, you might want to count how many orders were completed, in the West region, with a value over $500. Instead of manually filtering your data or creating helper columns, COUNTIFS allows you to answer that question with a single formula.

Both Excel and Google Sheets support COUNTIFS with nearly identical syntax, making it easy to use across platforms and within shared templates.

How Does COUNTIFS Work Behind the Scenes?

At its core, COUNTIFS evaluates rows one by one. For each row, it checks whether all specified conditions are met. If every condition evaluates to TRUE for that row, it’s included in the count. If even one condition fails, the row is ignored.

Each criterion consists of two parts: a range and a condition. The range tells the function where to look, and the condition tells it what to match. All ranges used in a COUNTIFS formula must be the same size and shape, or the function will return an error.

COUNTIFS uses logical AND by default, meaning all criteria must be satisfied at the same time. If you need OR logic, you’ll typically need multiple COUNTIFS formulas combined together.

When Should You Use COUNTIFS Instead of COUNTIF?

countifs infographic

COUNTIF is best when you only need to evaluate a single condition, such as counting how many cells contain “Yes” or how many values exceed a certain number. COUNTIFS becomes essential as soon as your logic requires multiple conditions.

You should use COUNTIFS when:

  • You need to count based on more than one column
  • Your logic includes numeric and text conditions together
  • You want to avoid helper columns or manual filters
  • You’re building dashboards, reports, or templates with dynamic criteria

In practice, most professional spreadsheets rely on COUNTIFS far more often than COUNTIF because real datasets rarely depend on a single variable.

What Is the Syntax of COUNTIFS?

The basic structure of COUNTIFS looks like this:

COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], …)

Each criteria range is paired with a corresponding criterion. You can include as many pairs as needed, as long as all ranges align.

The criteria themselves can include:

  • Exact text values
  • Numbers
  • Comparison operators (>, <, >=, <=)
  • Cell references
  • Wildcards (* and ?)

Understanding how to structure these criteria correctly is the key to mastering COUNTIFS.

COUNTIFS Formula Examples

Below are practical COUNTIFS examples that work in both Excel and Google Sheets. These examples are grouped here so you can quickly reference them without interrupting the conceptual explanations above and below.

Count Rows That Match Two Text Criteria

=COUNTIFS(A2:A100,”West”,B2:B100,”Completed”)

This formula counts how many rows are in the West region and have a status of Completed.

Count Values Based on a Numeric Condition and Text Condition

=COUNTIFS(A2:A100,”Sales”,C2:C100,”>500″)

This counts how many rows are labeled Sales where the numeric value exceeds 500.

Count Dates Within a Specific Range

=COUNTIFS(A2:A100,”>=1/1/2025″,A2:A100,”<=1/31/2025″)

This counts how many dates fall within January 2025. Dates are treated as numbers in both Excel and Google Sheets, so comparison operators work naturally.

Use Cell References Instead of Hardcoded Criteria

=COUNTIFS(A2:A100,E1,B2:B100,F1)

This allows your criteria to change dynamically based on values entered into cells E1 and F1, which is especially useful for dashboards and templates.

Use Wildcards for Partial Matches

=COUNTIFS(A2:A100,”North“,B2:B100,”Active”)

This counts rows where the text in column A contains the word “North” anywhere within it.

How Do You Use COUNTIFS with Numbers, Text, and Dates Together?

One of the biggest advantages of COUNTIFS is its ability to combine different data types in a single formula. You can count based on text categories, numeric thresholds, and date ranges simultaneously.

For example, imagine a task tracker where you want to count tasks assigned to a specific person, marked as high priority, and due this week. COUNTIFS can handle all of that in one formula as long as each condition is clearly defined.

The key is to ensure that numeric and date criteria use comparison operators enclosed in quotes, while text values are matched exactly unless wildcards are used.

What Are the Most Common COUNTIFS Mistakes?

Even experienced spreadsheet users run into issues with COUNTIFS. Understanding the most common mistakes will save you a lot of frustration.

One frequent error is mismatched range sizes. All criteria ranges must have the same number of rows and columns. If one range starts at row 2 and another starts at row 3, the formula will fail.

Another common issue is forgetting to put comparison operators inside quotation marks. For example, >500 must be written as “>500” or “>” & 500, not just >500.

Users also often misunderstand how text matching works. COUNTIFS is not case-sensitive, and it matches text exactly unless you use wildcards. Extra spaces in your data can also cause unexpected results.

Can COUNTIFS Handle OR Logic?

COUNTIFS only supports AND logic within a single formula. That means all criteria must be true at the same time. If you need OR logic—such as counting rows where a value is either “Yes” or “Maybe”—you’ll need to combine multiple COUNTIFS formulas.

For example, you can add two COUNTIFS results together, each representing one condition. While this approach works, it’s important to keep formulas readable and well-documented, especially in shared spreadsheets.

Are There Differences Between COUNTIFS in Excel and Google Sheets?

For most users, COUNTIFS behaves the same in Excel and Google Sheets. The syntax, supported operators, and wildcard behavior are consistent across both platforms.

However, there are a few subtle differences worth noting. Excel allows structured references when working with tables, which can make COUNTIFS formulas more readable in certain contexts. Google Sheets integrates more seamlessly with array formulas and dynamic ranges, which can affect how COUNTIFS is combined with other functions.

Despite these minor differences, any COUNTIFS formula you build in Excel will almost always work the same way in Google Sheets, making it safe for cross-platform templates.

How Does COUNTIFS Compare to Related Functions?

COUNTIFS is part of a family of conditional counting and summing functions. Knowing when to use each one will make your spreadsheets more efficient.

COUNTIF is limited to one condition and is best for simple counts. COUNTIFS expands on this by allowing multiple conditions. SUMIFS works the same way as COUNTIFS but adds values instead of counting rows. AVERAGEIFS calculates averages based on multiple criteria.

If you need to count unique values with conditions, COUNTIFS alone won’t be enough. In those cases, you’ll need to combine it with other functions such as UNIQUE or use more advanced formulas depending on your platform.

When Is COUNTIFS Not the Best Solution?

While COUNTIFS is powerful, it’s not always the best tool. If your logic becomes overly complex, with many OR conditions or dynamic arrays, other approaches like FILTER-based formulas or pivot tables may be easier to maintain.

COUNTIFS also doesn’t return which rows match—only how many. If you need to display the actual data that meets your criteria, FILTER is often a better choice.

Understanding these limitations helps you choose the right tool instead of forcing COUNTIFS to do something it wasn’t designed for.

How Can COUNTIFS Improve Templates and Dashboards?

COUNTIFS is especially valuable in templates where users want instant insights without touching the underlying data. Common use cases include counting completed tasks, tracking RSVPs, summarizing expenses by category, or monitoring inventory levels.

On Sheetrix, COUNTIFS is often used behind the scenes in dashboards to power summary metrics that update automatically as users enter data. Because the function is widely supported and easy to understand, it’s ideal for templates meant for beginners and professionals alike.

Final Thoughts: Why COUNTIFS Is a Must-Know Function

COUNTIFS is one of those functions that quietly does a lot of heavy lifting in well-designed spreadsheets. It allows you to summarize complex datasets with clarity, accuracy, and minimal effort. Once you understand how to structure criteria and avoid common mistakes, you’ll find yourself using COUNTIFS constantly.

Whether you’re building a simple tracker or a full-featured dashboard, mastering COUNTIFS will make your spreadsheets more flexible and far more useful. If you’re looking for ready-to-use templates that already apply COUNTIFS in practical ways, explore the resources available on Sheetrix and start working smarter with your data.

Shopping Cart
Scroll to Top