मुख्य सामग्री पर जाएँ
Math & StatsBasic LevelBasic Excel (Foundations & Core Formulas)

How to Use COUNTIF in Excel

Counts how many cells match a condition — duplicates, blanks, specific text, or values above a limit.

Direct Answer (Quick Summary)

What is COUNTIF in Microsoft Excel?

COUNTIF returns a number: how many cells in a range meet your criteria. It handles text, numbers, wildcards and comparison operators. It is the go-to function for duplicate checks, attendance counts and quick data-quality audits.

Pro Tip: Wildcards work inside COUNTIF: ? matches one character and * matches any number of characters. So =COUNTIF(A:A,"Lap*") counts every value starting with Lap.

Formula Syntax

=COUNTIF(range, criteria)

Arguments Breakdown

ArgumentRequirementPurpose & Details
rangeRequiredThe cells to inspect. Text, numbers and blanks are all valid targets.
criteriaRequiredWhat to count. A value, a cell reference, a wildcard pattern or an operator string such as ">=100".

When to Use COUNTIF (Real-World Business Scenarios)

  • 1

    Counting how many orders are still Pending or how many employees are in one department.

  • 2

    Finding duplicates with =COUNTIF(A:A,A2)>1 before you remove them.

  • 3

    Counting blanks with =COUNTIF(A2:A100,"") or non-blanks with "<>".

Step-by-Step Practical Business Example

Suppose you have the following dataset in Excel cells A1:D4:

Order IDStatus
ORD-101Delivered
ORD-102Pending
ORD-103Delivered
Applied Formula:Result: 2
=COUNTIF(B2:B4,"Delivered")

How it works: Scans the Status column and counts every cell that contains exactly 'Delivered'. The result is 2 because ORD-101 and ORD-103 are delivered.

Common Errors & How to Fix Them

Counts 0 for text that clearly exists

Why it happens: The cell contains extra spaces, or the match is case-insensitive but the value has a non-breaking space from a web export.

Fix: Clean the source with TRIM and CLEAN, or use a wildcard: =COUNTIF(B:B,"*Delivered*").

Numbers are not counted

Why it happens: The numbers are stored as text, so COUNTIF treats "100" and 100 differently in some imports.

Fix: Convert the column to numbers first, or count with SUMPRODUCT(--(range=100)) for full control.

Interactive Formula Lab

Try COUNTIF Live in Your Browser

No need to launch desktop Excel. Practice formulas with real-time feedback in our HyperFormula sandbox.

Open Practice Lab

Frequently Asked Questions (COUNTIF)

What does the COUNTIF formula do in Excel?

COUNTIF returns a number: how many cells in a range meet your criteria. It handles text, numbers, wildcards and comparison operators. It is the go-to function for duplicate checks, attendance counts and quick data-quality audits.

What is the syntax for COUNTIF?
=COUNTIF(range, criteria)
What are common mistakes when using COUNTIF?

Counts 0 for text that clearly exists: The cell contains extra spaces, or the match is case-insensitive but the value has a non-breaking space from a web export. (Clean the source with TRIM and CLEAN, or use a wildcard: =COUNTIF(B:B,"*Delivered*").) Numbers are not counted: The numbers are stored as text, so COUNTIF treats "100" and 100 differently in some imports. (Convert the column to numbers first, or count with SUMPRODUCT(--(range=100)) for full control.)

Keep building your formula toolkit with these math & stats functions.

Browse all 41 Excel formulas
Ready to Master Microsoft Excel?

Master COUNTIF in Basic Excel

Learn COUNTIF along with our formula library, practice files, and verifiable certificates in our complete curriculum.

सख़्त ज़रूरी