COUNTIF Excel Formula

Evaluates each value based on criteria, then counts how many values meet those criteria.

Syntax

Formula structure

Source: Quadratic docs
=COUNTIF(range, criteria)
range
Required: Yes

Required argument used by the COUNTIF formula.

criteria
Required: Yes

Required argument used by the COUNTIF formula.

Examples for the countif excel formula

Copy these examples into a spreadsheet and adjust the ranges for your own data.

COUNTIF syntax pattern

=COUNTIF(range, criteria)

Use this COUNTIF pattern as the starting point for your spreadsheet formula.

COUNTIF in a worksheet

=COUNTIF(A2:A10, criteria)

Evaluates each value based on criteria, then counts how many values meet those criteria.

When to use COUNTIF

Use COUNTIF when you need to evaluate each value based on criteria, then counts how many values meet those criteria.

  • Summarize ranges with counts, averages, variance, and standard deviation.
  • Build quick descriptive statistics.

How COUNTIF works in Quadratic

In Quadratic, COUNTIF follows the syntax COUNTIF(range, criteria). The function works inside Quadratic formulas and can be combined with spreadsheet ranges, tables, and other formulas.

Common COUNTIF mistakes

Most COUNTIF issues come from mismatched argument types, ranges that do not cover the intended data, or optional parameters being omitted when the default behavior is not what you expected.

  • Check each required parameter before copying the formula across a sheet.
  • Confirm that ranges line up with the rows or columns you intend to analyze.
  • Use Quadratic AI to explain or debug the formula when the result looks wrong.

Related formulas

COUNTIF formula FAQ

What does the countif excel formula do?

COUNTIF evaluates each value based on criteria, then counts how many values meet those criteria.

What is the syntax for COUNTIF?

The syntax is COUNTIF(range, criteria). Required and optional parameters are listed at the top of this guide.

Can Quadratic AI help with COUNTIF?

Yes. Quadratic AI can write a COUNTIF formula, explain existing formula logic, or help debug broken references and unexpected results.

Quadratic AI

Struggling with formulas? Use Quadratic AI.

Spreadsheet formulas are powerful, but they get painful fast. A COUNTIF formula can start simple, then turn into logic that is hard to understand, easy to break, and difficult to share with the rest of your team.

Quadratic AI helps you write formulas, explain formula logic, debug broken references, and move beyond formulas when advanced analysis needs Python, SQL, charts, or connected data.

Try Quadratic AI

Why formulas slow teams down

  • Long formulas become hard to read, understand, and trust.
  • Formula logic breaks when rows, columns, or assumptions change.
  • Manual updates make dashboards and reports fragile over time.
  • Complex formulas are difficult to explain, review, and share with teammates.
  • Advanced analysis quickly outgrows formula-only workflows.