Top Header ADS

COUNTIF Function in Excel

What is a COUNTIF function in Excel?

→ COUNTIF function is used to count cells in a range that meet a single condition. 

→ In simple language, COUNTIF_function helps us to count cells that fulfill defined criteria. 

→ We can use logical operators like (Greater Than (>), Less Than (<), Not equal to something (<>), Equal to (=)), and wildcards operator the asterisk (*) = character matches zero or more characters, question mark(?) = character matches with single characters for defining the criteria with COUNTIF function.

→ The criteria may be the exact match or it may be the partial match. In both conditions, this function will help us. 

→ This function returns a numeric value.

→ We can put COUNTIF Function in a Statistical Function Category


How to use the COUNTIF function in Excel?

→ You can refer to the Microsoft Excel tutorial to understand the COUNTIF function. 

→ COUNTIF_function explained below with examples.

→ We can simply use this function by adding the formula in the cell. 

 

What is the syntax of the COUNTIF function?

→ The syntax for the COUNTIF function in Microsoft Excel is:

=COUNTIF(range, criteria)  

The Syntax Parameter or Syntax Arguments are:

 range ⇒ It is the range of cells to count. 

 criteria ⇒ It is used to determine which cells to be counted. 

Note:

→ COUNTIF only supports a single condition. If you need to apply multiple criteria, use the COUNTIFS function. 


Examples of COUNTIF Function in Excel

→ For a better understanding of the COUNTIF function, we will understand with the help of examples

→ In the below picture we can see the different cars sold in different years. 

→ So, we need to count a cell that contains the specified value. 

→ For this, we will use the COUNTIF function.


Example 1: We need to count how many cells contain the value “BMW“

→ So, from the syntax, we know that the COUNTIF function has two parameters/arguments. We will understand one by one with the help of the Excel formula.

As per the syntax, we will use =COUNTIF(range, criteria) this formula

Example 1 of COUNTIF Function

➨ Parameter 1: Range

→ The first parameter in the COUNTIF function is the “range”. So we need to decide from which range we need to compare the criteria. 

→ In our case, we need to check how many cells contain the value as “BMW” car. So our criteria is “BMW”. BMW is available in the cell_range B2:B10. 

→ So our Range = B2:B10 in this example.

➨ Parameter 2: Criteria

→ In simple words from the selected range for which product/category we want to count that we need to mention. 

→ In the above example, we need to count the cells that contain value “BMW”. (Note: If we are mentioning the criteria as a text then we need to add text in between the double invited comma “”. E.g. “BMW”). 

→ We can mention criteria with two different methods. (1) we can mention as “BMW” or (2) We can give reference of cell-like in the above example we can give the cell reference = B2 cell because the value of B2 cell is BMW. 

So, the final result of =COUNTIF(B2:B10,"BMW") = 4


➨ Example 2: We need to count how many cells contain the value “Ford“

→ So, As per the above example, we can take one more example for a better understanding

With help of syntax =COUNTIF (range, criteria) now we will count the cells that contain “Ford”.

So as shown in the picture the formula will be =COUNTIF(B2:B10,"Ford") and it will return result = 3.

Example 2 of COUNTIF Function


👉 For a regular update:

➨ Join us (Telegram Channel)

➨ Join us (LinkedIn Page)


👉 Also Navigate Our Popular Category:

➨ Statistical Functions

➨ Date & Time Functions

➨ Logical Functions

➨ Lookup & Reference Functions

➨ Math Functions

➨ MS Excel Sitemap

➨ 7 QC Tools Excel Templates

➨ Lean Six Sigma Excel Templates

➨ MS Excel Templates

Post a Comment

Previous Post Next Post