COUNTIF Function in Excel can be used to count cells with dates, numbers, and text that match specific condition. The COUNTIF function in Excel supports logical operators (>,<,<>,=) and wildcards (*,?) for pattern matching.
Wild cards in COUNTIF Function
- ? – matches any single character
- * – matches any sequence of characters
The condition “A?e” will match all cells containing a text string beginning with “A” and ending in “e” and only one character in between i.e. A_e.
The condition “A*e” will match all cells containing a text string beginning with “A” and ending in “e” with multiple character(n) in between i.e. A_______e.
Syntax of COUNTIF Function in Excel:
- range – The range of cells to be counted.
- criteria – The criteria or condition on which cells should be counted
Example of COUNTIF Function in Excel
- First three examples states the use of logical operation in COUNTIF function.
- Last two examples states the use of wildcards in COUNTIF function.
So the result will be like
If you want to count the cells based on multiple conditions then use COUNTIFS Function in Excel, which is discussed in the next chapter.