Tutor 5 (54 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
COUNTIF is a function in Excel used to count the number of cells in a range that meet a specific condition or criteria.
Syntax of COUNTIF
The syntax of the COUNTIF function is:
COUNTIF(range, criteria)
-
range: The group of cells you want to evaluate.
-
criteria: The condition that determines which cells to count. This can be a number, text, logical expression, or even a cell reference.
How COUNTIF Works
-
The function scans each cell in the defined range.
-
It checks whether the content of each cell meets the condition specified in the criteria.
-
It returns the total count of cells that satisfy the condition.
Examples of COUNTIF
-
Counting Numbers Greater Than a Value
To count cells in the range A1:A10 that are greater than 50:
=COUNTIF(A1:A10, ">50")
-
Counting Exact Text Matches
To count cells in B1:B20 that contain the text "Completed":
=COUNTIF(B1:B20, "Completed")
-
Using Cell References in Criteria
To count cells greater than the value in cell C1:
=COUNTIF(A1:A10, ">" & C1)
-
Counting Cells Not Equal to a Value
To count cells in D1:D15 that are not equal to "Pending":
=COUNTIF(D1:D15, "<>Pending")
-
Counting Cells with Partial Text
To count cells in E1:E30 that contain the word "Report" anywhere in the text:
=COUNTIF(E1:E30, "*Report*")
The asterisks
*are wildcard characters that represent any number of characters.
Key Notes
-
COUNTIF works with one condition only. Use COUNTIFS for multiple conditions.
-
Text criteria are not case-sensitive. For example, "completed" and "Completed" are treated the same.
-
Logical operators like
>,<,>=,<=,<>must be enclosed in quotes.
Example of Practical Use
Suppose you have a sales report in A1:A12 with sales amounts, and you want to know how many sales exceeded $500:
=COUNTIF(A1:A12, ">500")
This will return the number of sales above $500, helping track performance quickly.
COUNTIF on Mac vs Windows
COUNTIF works the same way on both Mac and Windows versions of Excel. No differences exist in syntax or behavior.
This function is highly useful for data analysis, quality control, and tracking progress in reports. It saves time compared to manually counting cells that meet specific conditions.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
Why are margins not working
Answers · 1
Why is page layout not working
Answers · 1
How to print repeated rows on top in excel
Answers · 1
How to print header on each page
Answers · 1