Master COUNTIF in Google Sheets: A Step-by-Step Guide
Learn how to use google sheets countif to count cells by a single criterion, with practical examples, wildcard criteria, and guidance on when to switch to COUNTIFS for multiple conditions.

By the end, you will be able to count cells that meet a condition using google sheets countif. This quick solution supports text, numbers, dates, and wildcards, and you’ll learn how to adapt it for multiple criteria with COUNTIFS. We’ll cover practical examples, common mistakes, and best practices for reliable results.
What COUNTIF does in Google Sheets
COUNTIF is a built‑in function that counts cells in a range that meet a single criterion. In Google Sheets, the syntax is COUNTIF(range, criterion). The obvious use is to tally how many cells contain a particular label, value, or date. For example, if column A lists order statuses and you want to know how many are 'Open', you would enter =COUNTIF(A2:A100, "Open"). The function is fast, simple to audit, and works reliably in both small spreadsheets and larger datasets. It also serves as the building block for more complex tasks when combined with other functions such as COUNTIFS, SUMIF, or FILTER. Practically, COUNTIF helps teams measure compliance, track progress, and spot trends without needing to write complicated queries. In this article, we cover practical patterns for using google sheets countif effectively across a variety of data scenarios.
Basic syntax and simple examples
The core formula is COUNTIF(range, criterion). The range is the cell block you want to inspect, such as A2:A100 or B:B for entire columns. The criterion can be a fixed value (enclosed in quotes), a cell reference, or a comparison expression. For numeric tests, use operators like >, >=, <, or <= inside the criterion, e.g., =COUNTIF(D2:D100, ">50") counts all values greater than 50. If you want to reference a criterion from a cell, use =COUNTIF(E2:E100, E1). This makes it easy to adjust the rule without editing the formula. A common performance tip is to avoid using entire column references for very large sheets; instead, specify a precise range like A2:A5000 to keep recalculation fast. The key is consistency: ensure the range and criterion align in type (text vs numbers) to avoid unexpected results.
Text criteria and wildcards
Text matching is where COUNTIF shines, especially with wildcards. You can use exact text like =COUNTIF(B2:B100, "Shipped"), or you can exploit wildcards for pattern matching. The asterisk () represents any number of characters, and the question mark (?) represents a single character. For example, =COUNTIF(B2:B100, "Open") counts all statuses starting with Open, while =COUNTIF(B2:B100, "?ncluded") catches variations like 'Included' or 'Unincluded' depending on your data. Wildcards are particularly useful when you want to count items that share a prefix, suffix, or internal pattern. If your data might contain leading or trailing spaces, trim the data or use a more forgiving pattern with wildcards. Remember, the criterion is case-insensitive in Google Sheets, so 'OPEN' and 'Open' produce the same count.
Counting with numbers and dates
COUNTIF handles numerical thresholds with straightforward operators. Use criteria like ">=100" to count values at or above 100, or "<=0" for non-positive numbers. When counting dates, you can use absolute date literals or the DATE function: =COUNTIF(C2:C100, ">=DATE(2025,1,1)") counts dates on or after January 1, 2025. A common trick is to store the cutoff in a cell, e.g., put 2025-01-01 in F1 and use =COUNTIF(C2:C100, ">="&DATEVALUE(F1)). If your sheet uses time stamps, consider whether you want to count by date only (ignore time) or include time in the comparison. In mixed datasets, ensure your numbers are actually numeric (not text) to avoid miscounts.
COUNTIFS for multiple criteria
The COUNTIFS function extends COUNTIF to handle multiple criteria. The syntax is COUNTIFS(range1, criterion1, range2, criterion2, ...). For example, to count orders in West region with status 'Shipped', use =COUNTIFS(RegionRange, "West", StatusRange, "Shipped"). You can combine text, numbers, and dates as needed. COUNTIFS is powerful for dashboards that show, for instance, how many sales meet a price threshold in a given quarter. When criteria are derived from cells, keep the references absolute so you can copy the formula across sheets without breaking. For dynamic datasets, pair COUNTIFS with dynamic criteria from cells to keep your reports flexible.
Practical use cases
Real-world scenarios help cement COUNTIF usage. Use cases include counting open tasks in a to-do list, tallying sales by category, or determining how many students have a passing grade. For example, =COUNTIF(StatusRange, "Open") filters the number of open tasks. In education contexts, =COUNTIF(GradeRange, "A") shows the number of top performers. In sales, =COUNTIF(AmountRange, ">1000") reveals high-value orders. These straightforward formulas empower quick summaries and dashboards without requiring scripts. As you expand to COUNTIFS, you’ll handle more complex filters—like counting Open tasks in West region with due dates after a specific date—as part of a single, readable sheet.
Dynamic criteria with cell references
Using cell references for criteria makes COUNTIF adaptable. Instead of hard-coding a value, point the criterion to a cell, e.g., =COUNTIF(E2:E100, E1). You can also combine operators with cell references: =COUNTIF(D2:D100, ">="&F1) counts values greater than or equal to the date in F1. This approach is ideal for building interactive dashboards where users adjust a single control cell to refresh the count in real-time. When using dynamic criteria, ensure the control cell contains the correct data type (text, number, date) that matches your data. This pattern keeps your sheet flexible and reduces the need to rewrite formulas.
Alternatives and enhancements
COUNTIF is powerful, but not always enough for complex criteria. In those cases, combine COUNTIF with other functions such as FILTER, SUMIF, or SUMPRODUCT, or switch to COUNTIFS for multiple criteria. For example, =SUMPRODUCT((A2:A100="Open")*(B2:B100>50)) counts rows where A is Open and B exceeds 50. Another common pattern is using FILTER with COUNTA for dynamic lists: =COUNTA(FILTER(A2:A100, B2:B100="Open")). When you need to query across large datasets, consider QUERY as an alternative for more complex conditions and aggregations.
Best practices and performance
To keep formulas reliable and quick, prefer explicit ranges (e.g., A2:A5000) over entire columns in large sheets. Maintain consistent data types and clean data to avoid counting errors caused by stray spaces or non-printing characters. Document your formulas with comments or adjacent cells to explain the criterion, especially in shared workbooks. If you frequently adjust the criterion, place it in a dedicated cell and reference it in COUNTIF/COUNTIFS. Finally, test your counts against a known subset to verify accuracy before deploying dashboards to stakeholders.
Tools & Materials
- Google Sheets access(An active Google account and access to Google Sheets)
- Sample dataset(Spreadsheet with at least 3 columns and 20 rows)
- Formula examples cheat sheet(Optional reference sheet with COUNTIF/COUNTIFS variants)
- Keyboard and internet-connected device(For hands-on practice and syntax testing)
- Practice template(Optional file to experiment with various criteria)
Steps
Estimated time: 15-25 minutes
- 1
Open your dataset in Google Sheets
Launch a Google Sheets document that contains the data you want to analyze. Identify the column or range that will be the focus of COUNTIF, and note any headers that may help with readability. This step sets the context for accurate range selection and criterion application.
Tip: Include headers in the data range for clarity when presenting results. - 2
Select the target range
Choose the cells you want to count, such as A2:A100 for statuses or B2:B100 for amounts. Prefer a fixed, non-overlapping range to prevent counting header cells or empty rows. If your data grows, you can extend the range gradually as needed.
Tip: Use absolute range references (e.g., $A$2:$A$100) when copying the formula across columns. - 3
Enter the COUNTIF formula
In a blank cell, type =COUNTIF(A2:A100, "Open"). Adjust the range and criterion to fit your data. This basic example counts occurrences of the text Open in the chosen range.
Tip: Start with a simple criterion to confirm the function works before expanding. - 4
Use a criterion cell for flexibility
To make the rule reusable, place the criterion in a separate cell (e.g., E1) and reference it: =COUNTIF(A2:A100, E1). Changing E1 updates all dependent counts automatically.
Tip: Keep criterion cells clean and free of extra spaces. - 5
Apply the formula to multiple ranges
If you need multiple counts across columns, replicate the formula with adjusted ranges. Use helper cells to store different criteria for ease of comparison.
Tip: Copy formulas with relative ranges initially, then convert to absolute references as needed. - 6
Validate results with a quick check
Cross-check a sample count by manually tallying a small subset or using an alternative method like FILTER+COUNTA to ensure the result matches expectations.
Tip: If counts seem off, inspect for leading/trailing spaces or inconsistent data types.
FAQ
What is the difference between COUNTIF and COUNTIFS?
COUNTIF counts cells that meet a single criterion, while COUNTIFS can handle multiple criteria across different ranges. Use COUNTIF for simple tallies and COUNTIFS when you need to filter by more than one condition.
COUNTIF handles one condition; COUNTIFS handles several conditions at once.
Can COUNTIF count blanks or non-blanks?
Yes. To count non-empty cells, use COUNTIF(range, "<>"). To count blanks, use =COUNTIF(range, "").
Count blanks with an empty string as the criterion or use not-equal to.
Can COUNTIF work with dates?
Yes. Use date literals or DATEVALUE. For example, =COUNTIF(D2:D100, ">=DATE(2025,1,1)") counts dates on or after January 1, 2025.
COUNTIF works with dates using date-based criteria.
How do I count with criteria in a cell?
Reference a cell for the criterion, e.g., =COUNTIF(A2:A100, E1). This makes the count dynamic as you change E1.
Use a cell to hold the criterion for flexible counting.
What about counting unique values with COUNTIF?
COUNTIF cannot directly count unique values. Use a combination like SUMPRODUCT or FREQUENCY with UNIQUE values, or switch to a different approach with FILTER/QUERY for summaries.
COUNTIF alone doesn’t count unique values; consider SUMPRODUCT or FILTER-based methods.
Why isn’t my COUNTIF updating automatically?
Ensure the referenced ranges include the new data, and that the data type matches the criterion. If data changes in the source, Google Sheets recalculates automatically, but stale references or mixed data types can cause stale results.
If data changes, the count should recalculate; check range references and data types.
Watch Video
The Essentials
- COUNTIF counts cells matching a single criterion
- Use quotes for text and operators for numbers/dates
- COUNTIFS handles multiple criteria in one go
- Dynamic criteria via cell references increases flexibility
- Prefer explicit ranges over full columns for performance
