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") 
          Result : 5



  • Count of Sale not equal to 200 : Countif(C2:C10,"<>200") 
          Result :8



  • Count of cities except "Pune" : Countif(B2:B10,"<>Pune") 
          Result :6


  • Count the products start with "B"  : Countif(A2:A10,"B*")
          Result : 2


  • Count the products containing "Apple" wherever in cell : Countif(A2:A10,"*apple*")
           Result : 2


  • Count the products containing text "an" wherever in the cell :   
          Countif(A2:A10,"*"&"an"&"*") OR 
          Countif(A2:A10,"*an*")
          Result :3


  • Count the products having any first three character and next characters as "cream"
          Countif(A2:A10,"???cream")
          Result :1

  • Count the products that have exactly 9 characters and ends with "apple"
          Countif (A2:A10,"????apple")         
          Result = 1



Note :
  • Criteria is not case case sensitivee.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.


     






























Comments

  1. Great Shailaja. Thank you for information.

    ReplyDelete

Post a Comment