The COUNTIF function counts the number of cells within a range meeting the specified criteria. For example, you can count the number of times a value appear in a set of cells or you can also count the number of cells having value greater than 100 (or any other number suiting your need).
Syntax:
COUNTIF(range, criteria)
range(Required): One or more cells to count, including numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.
criteria(Required): A number, expression, cell reference, or text string that defines which cells will be counted.
Consider the example in below sheet
Now, if you wish to count number of subjects with marks greater than 70, you can use the below formula to give you the results
=COUNTIF(B2:B7,">70")
Similarly, if you are after the number of subjects with grade 'B', then you can use the following formula
=COUNTIF(C2:C7,"=B")
And, for subject with marks less than 70, you can use
=COUNTIF(B2:B7,"<70")
Note: You can also use wildcard characters, the question mark (?) and the asterisk (*) , in the criteria.
Consider the example in below sheet
Now, if you wish to count number of subjects with marks greater than 70, you can use the below formula to give you the results
=COUNTIF(B2:B7,">70")
Similarly, if you are after the number of subjects with grade 'B', then you can use the following formula
=COUNTIF(C2:C7,"=B")
And, for subject with marks less than 70, you can use
=COUNTIF(B2:B7,"<70")
Note: You can also use wildcard characters, the question mark (?) and the asterisk (*) , in the criteria.
0 comments:
Post a Comment