fxExcelReps
PRO

You've used your 3 free functions

To practise COUNTIFS and every other function, get a PRO subscription.

  • Unlimited access to every function
  • New functions and exercises every month
  • Every mistake explained + full solutions

Your free functions — you can always come back to these:

← All functions

How to use COUNTIFS in Excel

COUNTIFS counts rows that meet all of several conditions — orders from Varna for laptops, students who passed both exams.

Syntax

=COUNTIFS(range1, criteria1, [range2, criteria2], ...)

criteria_range1, criteria1The first range and condition.
[criteria_range2, criteria2], …More range/condition pairs.

Examples

=COUNTIFS(A2:A100, "Varna", B2:B100, "Laptop")Laptop orders from Varna.
=COUNTIFS(B2:B100, ">=60", C2:C100, ">=60")Passed both exams.
=COUNTIFS(D2:D100, ">="&E1, D2:D100, "<="&E2)Dates between E1 and E2.

Count with two or more conditions

Each condition is a pair: a range and what to look for in it. A row is counted only when every pair matches. All ranges must be the same size and start on the same row.

=COUNTIFS(C2:C500, "Overdue", D2:D500, ">10000")Overdue invoices above 10,000.
=COUNTIFS(B2:B500, "North", E2:E500, "<>Closed")Open cases in the North region.

Count between two dates

Use the same date column twice: once with >= the start date and once with <= the end date. Put the dates in cells and join them with &.

=COUNTIFS(A2:A500, ">="&G1, A2:A500, "<="&G2)Transactions between the dates in G1 and G2.
=COUNTIFS(A2:A500, ">="&DATE(2026,11,1), A2:A500, "<"&DATE(2026,12,1))Everything dated in November 2026.

Count A or B: add two COUNTIFS

COUNTIFS joins its conditions with AND. For OR, write one COUNTIFS per option and add them up, as long as the options can't both be true for the same row.

=COUNTIFS(B2:B500, "North", C2:C500, "Overdue") + COUNTIFS(B2:B500, "South", C2:C500, "Overdue")Overdue in the North or the South.
=COUNTIFS(A2:A500, ">="&G1, B2:B500, "North", C2:C500, "Overdue")Add a date condition the same way: overdue in the North since the date in G1.

Common mistakes

Ranges of different sizes
Every criteria range must have the same number of rows.
Counting one column between two values
Use the same range twice: COUNTIFS(B:B,">=10", B:B,"<=20").

Frequently asked questions

What's the difference between COUNTIF and COUNTIFS?

COUNTIF takes one condition, COUNTIFS up to 127. COUNTIFS with a single pair works exactly like COUNTIF, so you can always use COUNTIFS.

Why does COUNTIFS return #VALUE!?

The ranges have different sizes, for example A2:A500 and B2:B499. Make every range start and end on the same rows.

Why does COUNTIFS return 0 when there are matches?

The criteria don't match the data exactly: extra spaces, numbers stored as text, or a comparison written as ">G1" instead of ">"&G1.

Can COUNTIFS count non-blank cells?

Yes. "<>" means "not empty": =COUNTIFS(B2:B500, "North", F2:F500, "<>") counts North rows that already have a value in column F.

Available in: Excel 2007 and later, Excel for the web, Google Sheets

Related functions

COUNTIFSUMIFSAVERAGEIF