FormulaCraft

COUNTIF vs COUNTIFS: how they differ in Excel and Sheets

Topic:COUNTIF & COUNTIFS
Excel & Google Sheets
=COUNTIF(A2:A4,"Active")

Verified example

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

StatusRegion
ActiveNorth
InactiveSouth
ActiveNorth

=COUNTIF(A2:A4,"Active")2

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. 1Use COUNTIF for a single condition: =COUNTIF(range,criteria) — e.g., =COUNTIF(A2:A100,"Active") counts rows where A is 'Active'.
  2. 2Use COUNTIFS for multiple conditions: =COUNTIFS(range1,criteria1,range2,criteria2) — conditions are AND logic (all must be true).
  3. 3Example: =COUNTIFS(A2:A100,"Sales",B2:B100,">1000") counts rows where department is Sales AND amount is over 1000.
  4. 4For OR logic (either condition), add separate COUNTIF calls: =COUNTIF(A2:A100,"Sales")+COUNTIF(A2:A100,"HR") — or use COUNTIFS with SUMPRODUCT for complex OR.

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

Can COUNTIF count cells that are not equal to a value?

Yes — use the <> operator: =COUNTIF(A2:A100,"<>Active") counts all cells that are not 'Active'.

How do I count unique values with COUNTIF?

Use =SUMPRODUCT(1/COUNTIF(A2:A100,A2:A100)) — for each value, COUNTIF returns how many times it appears, 1/n gives the fractional weight, and SUMPRODUCT sums to the unique count.

More on COUNTIF & COUNTIFS

See all →

Formulas used

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

Last reviewed: