WorkbookLogic
FunctionStatisticalintermediateCOUNTIFSIFROWS

COUNTIFS Function

By WorkbookLogic

The Excel COUNTIFS function counts rows that meet multiple conditions. Each condition is supplied as a criteria range and criterion pair, and all conditions use AND logic.

ExcelLast reviewed Sep 11, 2026
countifs-function-v1.0.0.xlsx
Excel COUNTIFS Function
Count records that satisfy multiple criteria at the same time using aligned criteria ranges.
Source data, editableCOUNTIFS examples
RegionStatusOwnerAmountExampleCriterion 1Criterion 2Formula syntaxResult
NorthOpenAvery1,200.0North and openNorthOpen=COUNTIFS(A12:A21,F12,B12:B21,G12)2
SouthClosedBlair850.0North above 1,000North>1000=COUNTIFS(A12:A21,F13,D12:D21,G13)2
NorthOpenCasey1,450.0Open records for AveryOpenAvery=COUNTIFS(B12:B21,F14,C12:C21,G14)2
WestPendingAvery0.0
EastClosedBlair1,100.0How to read the examples
NorthClosedAvery760.0Each criteria pair filters the same source rows.
SouthOpenCasey1,325.0Every condition must be true for a row to contribute.
WestClosedBlair-100.0Keep every criteria range aligned with the source values.
NorthPendingCasey980.0
EastOpenAvery1,500.0
Reliability checks
Every COUNTIFS criteria range covers the same ten source rowsOK
North and open records equal the visible matching rowsOK

Overview

The Excel COUNTIFS function counts records only when every specified condition is satisfied. It is the natural extension of COUNTIF when one rule is not enough.

Quick reference

Syntax: =COUNTIFS(criteria_range1, criteria1, [criteria_range2], [criteria2], ...)

Returns: The number of rows for which every supplied condition is true. (number)

Arguments:

  • criteria_range1 (required) — The first range Excel evaluates.
  • criteria1 (required) — The condition applied to criteria_range1.
  • criteria_range2 (optional) — An additional range aligned row for row with the first criteria range.
  • criteria2 (optional) — The condition applied to criteria_range2; additional range and criterion pairs may follow.

Additional criteria-range and criterion pairs are optional. Every supplied condition must pass on the same row or position, and all criteria ranges must have matching dimensions.

Common uses

  • Count orders for one region and status.
  • Count records owned by one person above a value threshold.
  • Count dates inside a reporting period.
  • Measure rows that satisfy several completeness or exception checks.

Calculations

COUNTIFS evaluates corresponding positions across its criteria ranges. A row contributes one to the result only when its value in every range meets the paired criterion. Changing the order of the pairs does not change the result.

Every criteria range must have the same dimensions. For example, A12:A21 and B12:B21 are aligned ten-row ranges; combining A12:A21 with B13:B21 either returns an error or tests the wrong record structure.

Criteria follow the same rules as COUNTIF: comparison operators are quoted, a cell-based threshold is concatenated as ">"&G13, text matching is not case-sensitive, and * and ? act as text wildcards. All criteria are joined with AND logic. OR logic normally requires adding separate COUNTIFS results or using another approach.

Function behavior

Situation

Behavior

Multiple criteria

Uses AND logic; every condition must be true for a row to count.

One criterion pair

Works like COUNTIF for a single condition.

Different-sized ranges

Returns #VALUE!.

No matches

Returns 0.

Text case

Matching is not case-sensitive.

Comparison operators

Operators must be quoted and concatenated when paired with a cell reference or function result.

Wildcards

* and ? match text patterns; ~ escapes a literal wildcard.

Calculated arrays

Criteria ranges must be worksheet ranges rather than arrays returned by other functions.

Common errors

Counting each condition separately

What happens:
Two COUNTIF results describe separate populations and do not prove that the same rows meet both rules.

Better approach:
Put all aligned range and criterion pairs in one COUNTIFS formula.

Using ranges with different boundaries

What happens:
COUNTIFS returns #VALUE! when range dimensions differ, or the intended row alignment is lost.

Better approach:
Make every criteria range start and end on corresponding records.

Expecting OR logic

What happens:
A row that meets only one of two conditions is excluded because COUNTIFS requires both.

Better approach:
Add separate, non-overlapping COUNTIFS results for OR logic, or use a more suitable summary method.

Reversing a range and its criterion

What happens:
The alternating argument structure breaks and Excel cannot evaluate the formula as intended.

Better approach:
Write and review each condition as a visible pair: range first, criterion second.

Example

Example 1 — Two Text Conditions

=COUNTIFS(A12:A21,F12,B12:B21,G12)

With North and Open as the criteria, the workbook counts the two rows where both conditions are true.

Example 2 — Text and Numeric Comparison

=COUNTIFS(A12:A21,F13,D12:D21,G13)

This counts North records whose Amount also meets the comparison stored in G13. The result is 2.

Example 3 — Status and Owner

=COUNTIFS(B12:B21,F14,C12:C21,G14)

The formula counts rows that are Open and assigned to Avery. Two records qualify.

Example workbook

The workbook contains a COUNTIFS Example sheet with ten editable Region, Status, Owner, and Amount records. Three live formulas demonstrate text intersections and a numeric threshold, and two checks verify range alignment and the visible North/Open count. A Notes sheet explains AND logic and criteria construction.

Key takeaway

Pair every condition with an equally sized, row-aligned range, and remember that COUNTIFS includes a record only when all conditions are true.