COUNTIF Function in Excel – Count With One Condition Easily

Imagine you’re working with a product list or customer order sheet in Excel.

Some items say Available, some say Out of Stock, some say Pending, and a few cells are completely blank.

Now you want to know something very specific, like:

  • How many products are marked as Available?
  • How many orders have more than 100 units?
  • How many entries say Pending?

You don’t want to count everything.

you only want to count the cells that meet one condition.

Doing this manually?

Scroll… scroll… scroll…

“Did I count this one already?”

“Nope… starting again…”

This is where the COUNTIF function makes life so much easier.

In simple words:

COUNTIF = counts cells that match ONE specific condition.

Whether it’s numbers greater than 100, text like “Completed”, or dates after a certain day — COUNTIF can handle it.

What Is the COUNTIF Function?

The COUNTIF function in Excel counts how many cells meet one condition.

It works with:

  • numbers
  • text
  • dates
  • symbols
  • comparisons (`>`, `<`, `>=`, `<>`)
  • partial matches (`”abc”`)

COUNTIF is perfect when you want to filter your data using one rule.

Syntax:

=COUNTIF(range, criteria)

Arguments:

  • range: The cells you want to check
  • criteria: The condition the cells must match

You can use:

  • a number
  • text
  • a cell value
  • a comparison
  • a wildcard pattern

Examples:

Here’s a full product/order table to make the examples real:

Order IDCustomer NameProductQuantityStatusAmountRegion
101JohnLaptop2Delivered1200North
102SaraMouse1Pending20South
103RakeshKeyboard3Delivered90East
104MeeraLaptop1Cancelled600West
105DavidMonitor2Delivered300North
106AliMouse5Pending100East
107AnitaLaptop1Delivered600South
108ChrisKeyboard4Delivered120North
109PriyaLaptop3Pending1800West
110MohanMouse2Delivered40East

1. Count Orders Marked as Pending:

=COUNTIF(E2:E11, “Pending”)

COUNTIF Function in Excel Count Orders Marked as Pending

Result → 3 (Orders 102, 106, 109)

2. Count Quantities Greater Than 2:

=COUNTIF(D2:D11, “>2”)

COUNTIF Function in Excel Count Quantities Greater Than 2

Counts values greater than 2

Result → 4 (quantities: 3, 3, 4, 5)

3. Count Exact Matches (e.g., Quantity = 1):

=COUNTIF(D2:D11, 1)

COUNTIF Function in Excel Count Exact Matches (e.g., Quantity = 1)

Result → 3 (orders with quantity 1)

4. Count Blank Cells Using COUNTIF:

Even though COUNTBLANK exists, COUNTIF can do it:

=COUNTIF(A1:A10, “”)

COUNTIF Function in Excel Count Blank Cells Using COUNTIF

Counts empty cells.

Result: 0

5. Count Cells NOT Equal to Something:

=COUNTIF(E2:E11, “<>Pending”)

COUNTIF Function in Excel Count Cells NOT Equal to Something

Counts all statuses except “Pending”.

Result: 7

6. Count Text That Contains a Word (Exact Match):

For example, count all products contains “Laptop”:

=COUNTIF(C2:C11, “Laptop”)

COUNTIF Function in Excel Count Text That Contains a Word (Exact Match)

Result → 4 (all “Laptop” entries)

7. Count Dates Before or After a Specific Day:

Example: count dates after 01-01-2024:

=COUNTIF(A2:A11, “>01-01-2024”)

When Should You Use COUNTIF?

Use COUNTIF when you want to count only the values that match one condition.

Perfect for:

  • counting orders above a target
  • counting “Completed” tasks
  • counting students who passed (>40)
  • counting sales greater than a certain value
  • counting customers from a specific region
  • counting feedback containing keywords
  • counting products with a specific status

COUNTIF helps you filter and analyze data quickly, without complex formulas.

Related Functions (Quick Guide):

FunctionWhat It Does
COUNTCounts numbers only
COUNTACounts non-empty cells
COUNTBLANKCounts empty cells
COUNTIFCounts with one condition
COUNTIFSCounts with multiple conditions

In Simple Words:

 COUNTIF = count only what you need

 Works with one condition (like `>100`, `”Done”`, `”Laptop”`)

 Perfect for filtering, analyzing, and summarizing real data.

COUNTIF makes Excel smarter — and your work much faster.


Discover more from Excellopedia

Subscribe to get the latest posts sent to your email.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.