In this example "rng" is a named range that equals B5:B10.
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.
In the example shown, there is a list of colors in column B in a named range called rng. 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".
Criteria 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 <>:
rng,"<>red"// not equal to "red"
rng,"<>blue"// not equal to "blue"
To exclude other colors, add additional range/criteria pairs.
Alternative with SUMPRODUCT
The SUMPRODUCT function can also count cells that meet multiple conditions. For the above example, the syntax for SUMPRODUCT is:
In Excel, the operator for not equal is " ". For example: = A1 <> 10 // A1 is not equal to 10 = A1 <> "apple" // A1 is not equal to "apple" The COUNTIF function counts the number of cells in a range that meet supplied...
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...
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 (>,...
The SUMPRODUCT function multiplies ranges or arrays together and returns the sum of products. This sounds boring, but SUMPRODUCT is an incredibly versatile function that can be used to count and sum like COUNTIFS or SUMIFS, but with more...
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.