Excel formula: Count cells equal to x and y
As you known, the COUNTIF function can count the number of cells that match with a specified condition. Here in this tutorial, it will provide some formulas to talk about counting cells that match with all given conditions, which we call it the AND logic with the COUNTIFS function.
Count cells equal to x and y
If you want to count cells meeting two conditions simultaneously, x and y, you can use the COUNTIFS function in Excel.
Here is a table containing products, sales and prices, now you want to count the number of products which sales are larger than 10000 and price are larger than 100. Please use below formulas:
In above formulas, $C$3:$C$7 is the first range to evaluate, $G$2 and “>10000” are the first criterion, $D$3:$D$7 is the second range to evaluate, , $G$3 and “>100” are the second criterion.
The press Enter key to get the counted result: 2 (Computer and Camera).
Count cells equal to multiple criteria
If you want to count cells equal to multiple criteria, for example, there is a table including three columns, Column Store, Column Product and Column Number, now you want to count the number of rows that meet three criteria:
Store: North*, which means that the store name must begin with North, * is the wildcard that indicates any character string.
Using this formula
The press Enter key to get the counted result.
For multiple criteria, just adding the range and criteria into the formula as this: COUNTIFS(range1,criteria1,range2,criteria2, range3,criteria3, range4,criteria4…rangeN,criteriaN) .
- Count cells equal to
With the COUNTIF function, you can count cells that equal to or not contain a specified value.
- Count cells that equal to x or y
In some times, you may want to count the number of cells that meet one of two criteria, in this case, you can use the COUNTIF function.
- Count cells not equal to
Here this article introduce the formula to count cells that not equal to a given value.
- Count cells greater than or less than
This article talks about how to use the COUNTIF function to count the number of cell that greater than or less than a number