

The above formula uses the greater than an operator with the number as the criteria. Suppose I have a dataset as shown below and I want to count all the cells where the number in column B is greater than 30.īelow is the formula that will do this: =COUNTIF(B2:B10,">30") Just like I used the COUNTIF function with text, I can also use it with cells containing numbers. So I can also use ‘printer’ or ‘PRINTER’, as the result would still be the same Count Cells Value Greater than or Less than Note: Criteria text in the COUNTIF formula is not case sensitive. In this example, I have manually entered the criteria text, but you can also refer to a cell that contains the criteria text. The above formula uses the text I specified as the second argument as the criteria and counts all the cells that have the same text (which is “Printer”) Here is the formula that will do this: =COUNTIF(A2:A9,"Printer") Suppose you have a dataset as shown below and you want to count all the cells that have the text Printer in it. With the COUNTIF function, you can count all the cells that contain a specific text string.

#Countif function in excel how to#
Now let’s have a look at some examples that will show you how to use the COUNTIF function in Excel. criteria is the condition that must be evaluated against the range of cells for a cell to be counted.

range is the range of cells where you want to count cells that meet the condition.Let’s first look at the syntax of the COUNTIF function: Excel COUNTIF Function Syntax =COUNTIF(range, criteria) Count Cells Value Greater than or Less than.Count Cells With a Specific Text String.
