Skip to content
Excel

COUNTIF function in Excel

Counts the number of cells within a range that meet the given criteria

=COUNTIF(range, criteria)

COUNTIF syntax and parameters

Two arguments, two required.

  • rangerangeRequired

    The group of cells you want to count. Range can contain numbers, arrays, a named range, or references that contain numbers. Excel ignores blank and text values. Learn how to select ranges in a worksheet

  • criteriaanyRequired

    A number, expression, cell reference, or text string that determines which cells COUNTIF counts. For example, you can use a number like 32, a comparison like ">32", a cell like B4, or a word like "apples". COUNTIF uses only a single criteria. Use COUNTIFS if you want to use multiple criteria.

COUNTIF examples

Formulas you'll actually reuse.

  1. How many orders came from the West region:

    =COUNTIF(A2:A200, "West")

    Result47

  2. Deals above the average — build the criterion with &:

    =COUNTIF(C2:C200, ">" & AVERAGE(C2:C200))

    Result68

COUNTIF in Google Sheets

Same name — your formula ports as-is.

Try COUNTIF in the playground

Edit the example — nothing to install.

Preloaded with the COUNTIF formula from Example 1 — change anything and watch it respond.

Loading the editor…