ExcelTool.io

COUNTIF

Counts the cells in a range that meet a single condition.

Syntax

=COUNTIF(range, criteria)

Arguments

  • range - The range of cells to count.
  • criteria - The condition, e.g. ">100", "Yes", or "*text*".

Examples

=COUNTIF(A2:A100, "Complete")

Returns: Number of cells equal to "Complete"

Counts exact text matches.

=COUNTIF(A2:A100, "*error*")

Returns: Cells containing "error" anywhere

Wildcards (*) match partial text.

Common Errors and Gotchas

  • Wrap criteria in quotes, including comparisons like ">=100".
  • To count with multiple conditions, use COUNTIFS.
  • COUNTIF counts non-empty matches; use COUNTBLANK for empty cells.

Does COUNTIF Work in Google Sheets?

Yes. COUNTIF uses the same syntax in Google Sheets and LibreOffice Calc, so you can paste these formulas straight across.

Build a COUNTIF formula

Fill in your ranges and copy a ready-to-paste formula - no signup.

COUNTIF Generator