Back to functions
Statistical2026-03-185 related articles

COUNTIF Function in Excel

Count the number of cells in a range that meet a single condition.

Syntax

COUNTIF(range, criteria)

Arguments

range

Required

The range of cells to evaluate.

criteria

Required

The condition that determines which cells to count. Can be a number, text, expression, or cell reference.

What it returns

Returns the number of cells in the range that match the criteria.

What COUNTIF does

COUNTIF counts how many cells in a range match a condition. It works with numbers, text, dates, and expressions like greater-than or less-than.

For multiple conditions, use COUNTIFS instead.

Practical examples

Count cells that match a value

=COUNTIF(B2:B100,"Pass")

Counts every cell in column B that contains the text "Pass".

Count cells above a threshold

=COUNTIF(C2:C100,">"&70)

Counts cells with values greater than 70. The & operator joins the comparison operator with the number.

Count non-blank cells matching a pattern

=COUNTIF(A2:A100,"*report*")

Counts cells containing the word "report" anywhere in the text. The asterisk is a wildcard.

Common mistakes and notes

Text criteria need quotes

Criteria like "Pass" or ">70" must be wrapped in double quotes, even when they contain numbers.

COUNTIF is case-insensitive

"pass", "Pass", and "PASS" are all treated the same. For case-sensitive counting, use SUMPRODUCT with EXACT.

One condition only

COUNTIF accepts a single condition. For two or more conditions, use COUNTIFS.

Related functions

Related articles

Deep dives, troubleshooting guides, and practical examples that use COUNTIF.

Beginner
2026-08-12

How to Insert a Check Mark in Excel (5 Easy Methods)

Insert an Excel check mark with copy and paste, Symbol, a Windows shortcut, formulas, or conditional formatting. Learn when to use a checkbox instead....

#formatting#symbols#productivity
9 min read
Read Article
FormulasBeginner
2026-06-08

Compare Two Columns in Excel

Learn how to compare two columns in Excel for matches, differences, duplicates, missing values, and case-sensitive text....

#formulas#data cleanup#lookup
7 min read
Read Article
AI in ExcelAdvanced
2026-03-18

The Karpathy Loop for Excel: How Autoresearch Changes the Way We Optimize Spreadsheets

Learn how Karpathy's autoresearch pattern — the AI experiment loop that ran 700 tests in two days — applies to Excel formula optimization, VBA macros, and AI-assisted spreadsheet workflows....

#ai#automation#formulas#optimization
9 min read
Read Article
BeginnerFeatures
2018-05-23

5 New and Creative Ways To Utilize Excel

Excel is a program that is beneficial to anyone who wants to organize the utility bills or for professionals who need to stay organized at the office. To most Excel users, it can seem like a pretty cut and dry program. W...

8 min read
Read Article
FormattingFormulas
2018-03-27

How to Use the SUMIF and SUMIFS Functions in Excel

Lessen the time it takes to compute complex equations with the SUMIF and SUMIFS functions on MS Excel. This update may be just what you've been waiting for. Follow this in-depth, easy-to-follow guide to get started...

#criteria#formulas#functions#math
5 min read
Read Article

Official documentation