In this example "rng" is a named range that equals B5:B10.
How this formula works
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:
To count the number of cells that contain values not equal to a particular value, you can use the COUNTIF function . In the generic form of the formula (above) rng represents a range of cells, and X represents the value you don't want to count . All...
To count cells not equal to any of many things, you can use a formula based on the MATCH , ISNA , and SUMPRODUCT functions. In the example shown, the formula in cell F5 is: = SUMPRODUCT ( -- ( ISNA ( MATCH ( data , exclude , 0 )))) where "data" is...
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.