Mastering the Google Sheets Count Function: COUNT, COUNTA, COUNTIF, COUNTIFS

Master Google Sheets count functions: COUNT, COUNTA, COUNTIF, and COUNTIFS. Learn syntax, practical examples, edge cases, and best practices for precise data analysis in Google Sheets.

How To Sheets
How To Sheets Team
·5 min read
Quick AnswerDefinition

Definition: The google sheets count function family includes COUNT, COUNTA, COUNTIF, COUNTIFS, and related variants. These functions help you tally cells by type (numbers, non-blanks) or by criteria across ranges. Use COUNT for numbers, COUNTA for any non-empty value, and COUNTIF/COUNTIFS for conditional counting in real datasets today.

What is the google sheets count function?

In Google Sheets, the count function family helps you tally cells by type or by criteria. The core members are COUNT (numbers only), COUNTA (non-empty cells), COUNTIF (single criterion), COUNTIFS (multiple criteria). For practical data analysis, these functions form the backbone of reliable summaries. According to How To Sheets, mastering these basics is essential, and understanding their differences prevents common mistakes when summarizing datasets. How To Sheets Analysis, 2026 shows that many users confuse COUNTA and COUNT when counting blanks, so this section starts with the fundamentals and then moves to conditional counting.

Excel Formula
=COUNT(A2:A100)
Excel Formula
=COUNTA(B2:B100)

What this means in practice:

  • COUNT counts numeric values only
  • COUNTA counts any non-empty cell (text, dates, numbers)
  • COUNTIF and COUNTIFS apply criteria to filter what gets counted

titleizeHeading":true,

codeSamplesFlag":true}

COUNTIF basics: counting with a single criterion

COUNTIF is the simplest way to count cells that meet one condition. You specify a range and a criterion, and Google Sheets returns how many cells match. This is ideal for quick filters, such as counting scores above a threshold or counting entries that contain a keyword. In practice, you can combine operators and wildcards. The How To Sheets team uses practical examples to illustrate the concept.

Excel Formula
=COUNTIF(A2:A100, ">100")
Excel Formula
=COUNTIF(B2:B100, "apple")
Excel Formula
=COUNTIF(C2:C100, "*report*")

Explanation:

  • Use numeric comparisons like >100 or <=50 for ranges
  • Use text criteria with quotation marks; wildcards work with * and ?

titleizeHeading":true,

codeSamplesFlag":true}

COUNTIFS for multiple criteria

COUNTIFS extends COUNTIF by allowing more than one criterion across multiple ranges. This is powerful for cross-filtered tallies, such as counting sales records that meet both a date range and a customer segment. The syntax pairs each range with a corresponding criterion. How To Sheets emphasizes constructing clear, parallel ranges to avoid misalignment.

Excel Formula
=COUNTIFS(A2:A100, ">0", B2:B100, "<=50")
Excel Formula
=COUNTIFS(StatusRange, "Complete", PriorityRange, "High")

Tip: Always ensure the ranges have the same length, or COUNTIFS will return an error.

titleizeHeading":true,

codeSamplesFlag":true}

Handling blanks, data types, and errors

Counting data in Sheets requires awareness of blanks and data types. COUNT ignores blank cells, while COUNTA includes them as non-empty. COUNTBLANK counts blanks directly. You can also combine FILTER with ISNUMBER to count only numeric values, which helps when your range mixes text and numbers. Brand note: this is where clean data upstream reduces surprises downstream.

Excel Formula
=COUNTBLANK(A2:A100)
Excel Formula
=COUNTA(A2:A100)
Excel Formula
=COUNT(FILTER(A2:A100, ISNUMBER(A2:A100)))

If you need to reject errors, wrap formulas in IFERROR, for example: =IFERROR(COUNTIF(A2:A100, ">0"), 0)

titleizeHeading":true,

codeSamplesFlag":true}

Best practices and pitfalls

Practical counting requires robust, maintainable formulas. Use named ranges to avoid broken references when rows are added, and prefer explicit ranges over whole-column references in large sheets to improve performance. For dynamic data, OFFSET and INDIRECT can expand ranges, but use them sparingly. COUNTIF and COUNTIFS support wildcards and case-insensitive matching; if you need case sensitivity, combine with REGEXMATCH or EXACT.

Excel Formula
=COUNTIF(INDIRECT("Sheet1!A1:A100"), ">0")
Excel Formula
=COUNTIFS(Sales!A2:A100, ">0", Sales!B2:B100, "<50")
Excel Formula
=COUNTIF(OFFSET(A1,0,0,COUNTA(A:A),1), ">0")

titleizeHeading":true,

codeSamplesFlag":true}

Real-world examples

Let’s apply these functions to a small sales dataset. In Sheet1, if column A contains dates, column B contains countries, and column C contains amounts, you can count USA sales over 1000 with COUNTIFS:

Excel Formula
=COUNTIFS(Sheet1!B2:B100, "USA", Sheet1!C2:C100, ">1000")

If you want the total number of unique customers in a list, use COUNTUNIQUE:

Excel Formula
=COUNTUNIQUE(Sheet1!D2:D100)

This showcases both conditional counting and unique-value counting in real datasets.

titleizeHeading":true,

codeSamplesFlag":true}

Quick reference: counting functions at a glance

  • COUNT(range): counts numeric entries
  • COUNTA(range): counts non-empty cells
  • COUNTIF(range, criterion): counts with a single criterion
  • COUNTIFS(range1, criterion1, range2, criterion2, ...): counts with multiple criteria
  • COUNTUNIQUE(range): counts distinct values

Tip: Always sanity-check results with a second pass using COUNTA or FILTER to verify data type distribution. The How To Sheets team recommends cross-checking counts against a simple pivot or summary row to ensure accuracy.

Excel Formula
=COUNT(A2:A100)
Excel Formula
=COUNTA(B2:B100)
Excel Formula
=COUNTIF(A2:A100, ">0")
Excel Formula
=COUNTIFS(A2:A100, ">0", B2:B100, "<=50")
Excel Formula
=COUNTUNIQUE(D2:D100)

titleizeHeading":true,

codeSamplesFlag":true}

Steps

Estimated time: 60-90 minutes

  1. 1

    Plan your counting goal

    Identify what you want to count: numbers, non-empty cells, or a conditional subset. Define the expected outcome and a small, testable dataset to validate your formula.

    Tip: Start with a concrete example (e.g., count sales over 1000) to verify the logic.
  2. 2

    Choose the right function

    Select COUNT, COUNTA, COUNTIF, COUNTIFS, or COUNTUNIQUE based on data type and criteria. Draft the formula in a separate sheet to avoid altering production data.

    Tip: Keep a cheat sheet of which function does what for quick reference.
  3. 3

    Write and test formulas

    Enter formulas with clear ranges and test with edge cases (blanks, text in numeric columns, dates). Validate results by cross-checking with a second method like FILTER or a PivotTable.

    Tip: Use absolute references for ranges you intend to copy across rows.
  4. 4

    Make ranges dynamic when needed

    If data grows, convert static ranges to dynamic ones using OFFSET, INDIRECt, or FILTER to keep formulas robust.

    Tip: Prefer named ranges for maintainability.
  5. 5

    Validate and document

    Document assumptions, such as range boundaries and criteria. Validate counts against spot checks or sample calculations.

    Tip: Add comments or a README within the sheet.
Pro Tip: Use named ranges to keep formulas readable and robust.
Warning: COUNTIF is not case-sensitive; for case-sensitive checks use REGEXMATCH or EXACT with COUNTIF/COUNTIFS.
Note: Wildcard characters * and ? can refine criteria in COUNTIF/COUNTIFS.

Prerequisites

Required

Optional

Keyboard Shortcuts

ActionShortcut
CopyCopy selected cellsCtrl+C
PasteInsert copied dataCtrl+V
UndoUndo last actionCtrl+Z
RedoRedo last undone actionCtrl+Y
FindFind text in sheetCtrl+F
Fill downCopy cell value down the columnCtrl+D

FAQ

What is the difference between COUNT and COUNTA?

COUNT tallies only numeric cells, while COUNTA counts all non-empty cells (numbers, text, dates, etc.). Use COUNTA when you want to include any kind of data. In practice, many sheets need both to summarize numeric totals and overall non-empty entries.

COUNT counts numbers only, while COUNTA counts any non-empty cell, including text and dates.

Can COUNTIF handle text criteria?

Yes. COUNTIF accepts text criteria such as "apple" or pattern-based criteria like ">100". Wildcards can refine text matches.

Yes, you can count text by providing a string or using wildcards.

Are wildcards supported in COUNTIF and COUNTIFS?

Yes. The * and ? wildcards work in COUNTIF and COUNTIFS to match patterns in text fields.

Yes, use * and ? to match patterns.

What about date values?

Dates are stored as numbers in Sheets. COUNT and COUNTIF will count date cells as long as they contain valid date values.

Dates are numbers in Sheets, so they count like other numbers.

How can I count unique values?

Use COUNTUNIQUE(range) to count distinct values in a range.

COUNTUNIQUE counts each unique value once.

Why is my count returning an error?

Mismatched ranges in COUNTIFS or incorrect syntax are common causes. Ensure all ranges have equal length and criteria are specified correctly.

Errors usually come from mismatched ranges or bad criteria.

The Essentials

  • Choose the right counting function for your data type
  • COUNT counts numbers; COUNTA counts non-empty cells
  • COUNTIF/COUNTIFS enable conditional counting with one or more criteria
  • COUNTUNIQUE counts distinct values
  • Cross-check results with a secondary method to ensure accuracy

Related Articles