How to Use COUNTIF and COUNTIFS Function in Excel
Excel is a useful tool for data analysis, and one of the most essential functions users need to learn is COUNTIF and COUNTIFS. These two functions allow you to count the number of cells in a range that meet a certain condition. Here’s how to use COUNTIF and COUNTIFS in your Excel spreadsheets.
COUNTIF Function
COUNTIF is a function that counts the number of cells in a range that meet a specified condition. This function takes two arguments, the range of cells and the criteria or condition to meet. You can use various operators such as =, <, >, <=, >=, and <> to specify the criteria.
Syntax: =COUNTIF(range, criteria)
Example: Let’s say you have a list of customers and you want to count the number of customers who have purchased a product costing more than $500. You can use the COUNTIF function in the following way:
=COUNTIF(B2:B10, “>500”)
Here, B2:B10 is the range of cells that contain the product prices, and “>500” is the criteria.
COUNTIFS Function
If you need to count cells that meet multiple conditions, you can use the COUNTIFS function. This function works the same as COUNTIF, but it allows multiple criteria. You can use up to 127 criteria in a single COUNTIFS function.
Syntax: =COUNTIFS(range1, criteria1, [range2], [criteria2], …)
Example: Let’s say you have a list of products, their prices, and the salesperson who sold them. You want to count the number of products sold by John costing more than $500. You can use the COU
=COUNTIFS(B2:B10, “>500”, C2:C10, “John”)
Here, B2:B10 is the range of product prices, “>500” is the first criteria, C2:C10 is the range of salesperson names, and “John” is the second criteria.