FormulaCraft

How to count rows that match a condition in Excel and Google Sheets

Excel & Google Sheets
=COUNTIF(B2:B6,">50")

Verified example

Computed by a real spreadsheet engine on the sample data below.

RegionSales
North80
South45
North60
East30
West75

=COUNTIF(B2:B6,">50")3

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Identify the column(s) to evaluate and the condition(s) to apply.
  2. 2For one condition, use =COUNTIF(B2:B6,">50").
  3. 3For two conditions, use =COUNTIFS(A2:A6,"North",B2:B6,">50").
  4. 4Criteria operators include: >, <, >=, <=, <>, =, and wildcards * and ?.
  5. 5Press Enter to see the count.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

What is the difference between COUNTIF and COUNTIFS?

COUNTIF takes one range and one criterion. COUNTIFS takes multiple range-criterion pairs and counts rows that satisfy all of them simultaneously (AND logic).

How do I count rows where a cell is not empty?

Use =COUNTIF(A2:A6,"<>") to count non-empty cells.

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: