Statistical
8.1K monthly searches
Beginner
4 min read

COUNTIF Function in Excel - Count Cells Meeting Criteria

Count how many cells meet a specific condition with this powerful conditional counting tool....

Quick Start

Syntax

=COUNTIF(range, criteria)

Parameters

range - Required. The range of cells to evaluate (e.g., A1:A100, B:B). Can be a single column or multiple columns.

criteria - Required. The condition that determines which cells to count (e.g., "East", ">90", "A*", TODAY()). Can be number, text, date, or comparison.

Simplest Example

ABC
1RegionSalesCount East
2East1200
3West950
4East1500
5East800
6North1100
7
=COUNTIF(A2:A6, "East")
3

Quick Reference

Count Text Matches
=COUNTIF(A:A, "East")

Counts how many cells contain "East" (case-insensitive)

=COUNTIF(A:A, "East") → 15

Count Greater Than
=COUNTIF(B:B, ">90")

Counts cells with values greater than 90

=COUNTIF(B2:B50, ">90") → 8

Count with Wildcards
=COUNTIF(A:A, "A*")

Counts cells starting with "A" (* = any characters)

=COUNTIF(A:A, "A*") → 12

Count Not Equal
=COUNTIF(C:C, "<>Pending")

Counts cells that don't contain "Pending"

=COUNTIF(C2:C100, "<>Pending") → 67

Real-World Examples

Count Sales by Region for Distribution Analysis

Tally how many sales transactions occurred in each region using conditional counting. Track regional performance, identify top markets, analyze geographic distribution patterns across multiple territories and time periods. This formula is essential for sales managers, regional directors, and business analysts who need territory analysis and market penetration metrics for strategic planning and resource allocation. Use it for any categorization scenario: count by department, product type, customer segment, status code, priority level, or any custom classification across your entire dataset for comprehensive business intelligence reporting and executive dashboards.

ABC
1TransactionRegionEast Count
21East
32West
43East
54East
65North
7Result:
=COUNTIF(B2:B6, "East")
3
Pro Tip: Use dynamic criteria with cell references: =COUNTIF(A:A, D1) where D1 contains the region name for flexible dashboards.
Pattern: =COUNTIF(range, "category") for frequency analysis
Count Students Above Grade Threshold

Use comparison operators with conditional counting to determine how many students scored above a specific threshold in exams or assignments. Calculate pass rates, identify top performers, track achievement distributions across entire classrooms, grade levels, or school districts. This formula handles numeric comparisons perfectly - essential for teachers, academic advisors, and education administrators building grade reports, performance dashboards, and academic tracking systems that need automatic counting based on score criteria for institutional reporting, student assessment analysis, accreditation documentation, and educational outcome measurements.

ABC
1StudentScoreA Count (≥90)
2Alice95
3Bob78
4Carol92
5David88
6Emma91
7Result:
=COUNTIF(B2:B6, ">=90")
3
Pattern: Use ">", "<", ">=", "<=", "=" or "<>" for numeric comparisons

Common Mistakes to Avoid

=COUNTIF(A:A, A1)Forgetting quotes around text criteria

❌ The Problem:

  • Cell reference instead of literal text value
  • Formula looks for cells equal to A1's value (correct)
  • But if you meant to find "A1" as text, it won't work
  • Confusion between literal text and cell references

✅ Solution:

=COUNTIF(A:A, "Complete")

Use quotes around literal text criteria: "East", "Approved", "Complete". This function treats criteria without quotes as cell references or numbers by default. If you want to match specific text strings exactly, always use double quotes around the text for clarity and proper formula execution. This distinction is crucial for preventing errors and ensuring your counting logic works as expected.

=COUNTIF(A1:A10, >90)Missing quotes around comparison operators

❌ The Problem:

  • Syntax error - comparison operators need quotes
  • Formula won't work without proper formatting
  • Excel can't interpret the criteria correctly
  • Common mistake when counting with numeric conditions

✅ Solution:

=COUNTIF(A1:A10, ">=90")

Always wrap comparison operators in quotes: "&gt;=90", "&lt;100", "&lt;&gt;0", "&lt;=50". This formula requires criteria to be text strings, even for numeric comparisons and mathematical operations. This syntax allows the function to properly parse and apply the conditional logic correctly. Without quotes, you'll get a syntax error and the formula won't work at all.

=COUNTIF(A:A, "east")Expecting case-sensitive matching

❌ The Problem:

  • This function is case-insensitive by default
  • "east" matches "East", "EAST", "EaSt"
  • Can't distinguish between case variations
  • May count more than expected

✅ Solution:

=SUMPRODUCT(--(EXACT(A:A, "east")))

For case-sensitive counting, use SUMPRODUCT with EXACT function instead of standard conditional counting methods. The default function treats "East" and "east" as identical by design. EXACT performs case-sensitive comparison for precise matching and text differentiation. This pattern is essential when case matters in your data classification or coding systems where upper and lowercase letters have different meanings and must be distinguished for accurate results.

Frequently Asked Questions

Other Statistical Functions

Related Formulas

Master these COUNTIF variants:

Master Excel COUNTIF

From basics to advanced - AI generates perfect formulas instantly.