In this example, the goal is to count the number of cells in data (B5:B15) that are not equal to "red" or "blue". This problem can be solved with the COUNTIFS function or the SUMPRODUCT function, as explained below.
Not equal to
The not equal to operator in Excel is <>. For example, with the number 10 in cell A1:
=A1<>5// returns TRUE=A1<>10// returns FALSE
The first formula returns TRUE since A1 is indeed not equal to 5. The second formula returns FALSE since A1 is equal to 10.
The COUNTIFS function counts the number of cells in a range that meet one or more supplied criteria. All conditions must pass in order for a cell to be counted, so you can think of COUNTIFS as using AND logic to join conditions.
In the example shown, there is a list of colors in column B in the named range data (B5:B15). We want to count cells where the color not red or blue. To solve this problem, we need two separate conditions: (1) not equal to "red", and (2) not equal to "blue". The conditions given to COUNTIFS are supplied with range/criteria pairs, and can use logical operators. The key in this case is to use the "not equals" operator, which is <>. The conditions we need are:
data,"<>red"// not equal to "red"
data,"<>blue"// not equal to "blue"
When we place these conditions in COUNTIFS, the result is 4, since there are 4 cells that contain colors not equal to "red" or "blue":
In this example, the goal is to count the number of cells in column D that are not equal to a given color. The simplest way to do this is with the COUNTIF function , as explained below. Not equal to In Excel, the operator for not equal to is " "...
First, a little context. Normally, if you have just a couple things you don't want to count, you can use COUNTIFS like this: = COUNTIFS ( range , "<>apple" , range , "<>orange" ) But this doesn't scale very well if...
In this example, the goal is to count the values in column B listed in the range E5:E7. One way to do this is to give the COUNTIF function all three values in the named range things (E5:E7) as criteria, then use the SUMPRODUCT function to get a...
The Excel COUNTIFS function returns the count of cells that meet one or more criteria. COUNTIFS can be used with criteria based on dates, numbers, text, and other conditions. COUNTIFS supports logical operators (>,...
Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.