Countif Function
COUNTIF Function: Use COUNTIF to count the number of cells that meet the criteria.
Syntax : Countif <Range,Criteria>
Example :
Table_1 :
| A | B | C | |
1 |
Product | City | Sale |
| 2 | Strawberry | Bangalore | 100 |
| 3 | Pineapple | Mumbai | 200 |
| 4 | Apples | Pune | 650 |
| 5 | Mango | Nagpur | 700 |
| 6 | Orange | Nashik | 650 |
| 7 | Grapes | Mumbai | 400 |
| 8 | Banana | Bangalore | 600 |
| 9 | Biscuits | Pune | 300 |
| 10 | IceCream | Pune | 500 |
- Count of Sale over 500 : Countif(C2:C10,">=500")
- Count of Sale not equal to 200 : Countif(C2:C10,"<>200")
- Count of cities except "Pune" : Countif(B2:B10,"<>Pune")
- Count the products start with "B" : Countif(A2:A10,"B*")
- Count the products containing "Apple" wherever in cell : Countif(A2:A10,"*apple*")
- Count the products containing text "an" wherever in the cell :
Countif(A2:A10,"*an*")
- Count the products having any first three character and next characters as "cream"
Result :1
- Count the products that have exactly 9 characters and ends with "apple"
Result = 1
Note :
- Criteria is not case case sensitive. e.g. "apples" and "APPLES" will match the same cells.
- Use of Wildcard characters in Countif Function
- Question Mark (?) : A question mark matches any single character.
- Asterisk (*) : An asterisk matches any sequence of characters.
If you want to find an actual question mark or asterisk, type a tilde (~) in front of the character.
Great Shailaja. Thank you for information.
ReplyDelete