COUNTIF is the function, which is used to count number of cells in a list that matches a particular condition.
Syntax
=COUNTIF(list,”condition”)
Here list is the range of cells selected and condition can be in the form of arithmetic, text or logical expression.
Find below some of the examples:
In the above picture the range of cells between Row 2 and Row 6 are counted by different expressions.
Arithmetic expressions:
=COUNTIF(B2:B6,”>500”)
Here condition is to count cells that are greater than 500. The range of cells is between B2 and B6. There are two cells (B2 is 780 and B4 is 650) that meet the condition, so COUNTIF function returns 2
Text expression:
=COUNTIF(E2:E6, “Lara”)
Here condition is to count cells that have name Lara. The range of cells is between E2 and E6. Three cells B2, B3 and B5 matches the given condition, so COUNTIF function returns 3
Logical expression:
=COUNTIF(H2:H6, “false”)
Here condition is to count cells that have logical value FALSE. The range of cells is between H2 and H6. Two cells have the matching logical value, so COUNTIF function returns 2.
Intersting posts are yet to come. So keep visiting this blog. :-)