How to Count Not Equal To Multiple Criteria in Excel
Learn multiple Excel methods to count not equal to multiple criteria with step-by-step examples, practical use cases, and expert tips.
How to Count Not Equal To Multiple Criteria in Excel
Why This Task Matters in Excel
Have you ever needed to count everything except a small list of exclusions—perhaps every product except discontinued items, or every employee except contractors and interns? Counting records that do not meet one or more conditions is deceptively common. In operations, you may want to know how many orders are still “open” and not in a set of finalised statuses like “Shipped” or “Cancelled.” In finance, you might need the count of transactions that are not in specific GL accounts. Marketers often analyse survey responses while excluding “Prefer not to say” or “N/A.”
In each scenario, failure to exclude the right categories leads to skewed KPIs and misguided decisions. Over-reporting revenue-generating orders, under-counting customers who actually churned, or including dormant SKUs in stock-turn calculations can cost money and credibility. Excel remains the go-to tool for fast, flexible analysis because it lets you combine structured tables, dynamic named ranges, and powerful aggregation functions in a single workbook.
Knowing how to count anything that is not in a list of criteria complements skills such as filtering, conditional formatting, and dashboarding. It dovetails with other logical tasks like “contains text,” “starts with,” or “greater than” queries, forming a core part of the data-wrangling toolkit. When you master this, you will work faster, build cleaner models, and be able to maintain reports with minimal manual intervention.
Best Excel Approach
The fastest, most transparent way to count items that are not equal to multiple criteria is to use COUNTIFS with a separate “not equal” condition for each exclusion value. COUNTIFS supports up to 127 criteria pairs, is fully dynamic with Table references, and recalculates efficiently on large datasets.
=COUNTIFS($B:$B, "<>"&"Apple",
$B:$B, "<>"&"Banana")
Explanation of parameters
- Criteria_range1 – the column being evaluated
- Criteria1 – concatenation of the not-equal symbol pair and the first exclusion value
- Criteria_range2 / Criteria2 – repeat for every additional exclusion
COUNTIFS returns the number of rows where all criteria are simultaneously true, meaning the cell in column B is “not Apple” and “not Banana.”
When you have many exclusions or need extreme flexibility (e.g., criteria stored in a spill range), SUMPRODUCT or the newer COUNT(FILTER()) combination can be preferable.
=SUMPRODUCT(--ISNA(MATCH($B$2:$B$500, $E$2:$E$10, 0)))
- MATCH searches for each record in the exclusion list
- ISNA returns TRUE for items not found
- The double minus converts TRUE/FALSE to 1/0
- SUMPRODUCT adds the 1s to give the count
Parameters and Inputs
- Data Range – The column (or columns) you are evaluating must be of consistent data type—text or numbers. Mixed data can lead to mismatches.
- Exclusion Values – Literal strings like \"Apple\" or numerics like 101 stored in cells, named ranges, or entered directly in the formula.
- Absolute vs Relative References – Lock column references with $ if you plan to copy formulas sideways.
- Case Sensitivity – COUNTIFS is not case-sensitive, while MATCH with 0 is. Adjust with EXACT if you require case accuracy.
- Wildcards – COUNTIFS supports ? and * in text criteria. Use \"*Inc\" to exclude strings ending with “Inc.”
- Blank Cells – If blanks should be counted, ensure you do not accidentally treat \"\" as another exclusion.
- Dynamic Arrays – In Office 365, spill ranges can pass a variable list of exclusions directly into MATCH or the new EXCLUDE list with the function XLOOKUP’s
if_not_found.
Step-by-Step Examples
Example 1: Basic Scenario
Imagine a small fruit inventory in [A1:B11]:
| Row | Fruit | Quantity |
|---|---|---|
| 1 | Apple | 18 |
| 2 | Pear | 11 |
| 3 | Peach | 15 |
| 4 | Banana | 21 |
| 5 | Apple | 17 |
| 6 | Plum | 9 |
| 7 | Mango | 13 |
| 8 | Pear | 5 |
| 9 | Kiwi | 12 |
| 10 | Apple | 7 |
Objective: Count all rows where the Fruit is not Apple and not Banana.
Step-by-step:
- Place the formula below in any empty cell (say, D2):
=COUNTIFS($B$1:$B$10, "<>"&"Apple",
$B$1:$B$10, "<>"&"Banana")
- Press Enter. The expected result is 6 because rows 2,3,6,7,8,9 are neither Apple nor Banana.
Why it works: COUNTIFS only increments the count when both tests return TRUE for the same row. Blanks are treated as valid when they meet the criteria.
Variations:
- To exclude a third fruit, e.g., Pear, append another criteria pair.
- If the exclusion list is stored in [E1:E3], you could switch to SUMPRODUCT+MATCH.
Troubleshooting:
- If you get zero, confirm spelling—COUNTIFS is unforgiving of extra spaces.
- Numbers stored as text can be reconciled by wrapping the range in VALUE or using a helper column.
Example 2: Real-World Application
Scenario: A customer service team logs tickets in an Excel Table named [tblTickets]. Column [Status] contains: “Open,” “Pending,” “Resolved,” “Escalated,” and “Cancelled.” Management wants to know how many tickets are not yet complete—that is, they are not “Resolved” and not “Cancelled.”
Data snapshot (simplified):
| TicketID | Agent | Status |
|---|---|---|
| T1001 | Ivy | Open |
| T1002 | Wei | Pending |
| T1003 | Ana | Resolved |
| T1004 | Raj | Cancelled |
| T1005 | Mei | Open |
| … | … | … |
Step-by-step:
- Because it is a Table, use structured references for readability. Enter the formula in a cell on the same worksheet, maybe at the top of a dashboard:
=COUNTIFS(tblTickets[Status],"<>"&"Resolved",
tblTickets[Status],"<>"&"Cancelled")
-
Result: Count of active tickets. In the sample above, tickets T1001, T1002, and T1005 qualify, so the result is 3.
-
Integrate with conditional formatting: highlight the dashboard metric in red when the count exceeds a service-level threshold.
-
Link to charts: build a Gauge chart driven by the COUNTIFS cell.
Performance considerations:
Table references are memory-efficient. COUNTIFS recalculates only when [Status] changes, not on every keystroke elsewhere, ideal for thousands of tickets.
Example 3: Advanced Technique
Challenge: In a sales ledger of 100 000 rows, you need the count of invoices whose Region is not in a user-defined exclusion list stored in spill range [G2#]. Regions may be added or removed at any time.
Approach: Combine the modern FILTER and COUNTA functions (Office 365) with the implicit intersection operator.
=COUNTA(FILTER(A2:A100001, ISNA(MATCH(B2:B100001, G2#, 0))))
- Column A holds Invoice numbers, Column B holds Region.
- MATCH returns a numeric position when Region is found in the exclusion list; otherwise, #N/A.
- ISNA converts #N/A to TRUE, meaning “keep this row.”
- FILTER returns only the invoices not in the exclusions.
- COUNTA tallies the resulting spill.
Edge-case management:
- If all rows are excluded, FILTER returns #CALC! error. Wrap with IFERROR to return zero.
=IFERROR(
COUNTA(FILTER(A2:A100001, ISNA(MATCH(B2:B100001, G2#, 0)))),
0)
Performance: FILTER is highly optimised for large arrays, often faster than legacy SUMPRODUCT loops.
Professional tip: Spill ranges automatically resize, so refreshing the exclusion list with Power Query or a dynamic drop-down instantly updates the count with no formula edits.
Tips and Best Practices
- Store exclusions in a Named Range or Table Column so business users can update the list without touching formulas.
- Use absolute references ($) when building COUNTIFS so copying or filling the formula does not accidentally shift the criteria range.
- Concatenate the not-equal operator with cell values (
"<>"&F2) instead of hard-coding strings; this avoids typos and supports case updates. - Leverage dynamic arrays in Office 365 for variable-length exclusion lists; they future-proof your model.
- Document your formula logic with cell comments or a small legend explaining the not-equal operator—non-technical colleagues often misinterpret \"<>\".
- Test at small scale first; validate counts with manual filters before rolling out to the entire workbook.
Common Mistakes to Avoid
- Using a single criteria string like \"<>Apple, Banana\" – COUNTIFS treats that as literal text and not two separate exclusions. Split into multiple criteria pairs.
- Mixing data types (text \"101\" and numeric 101) in the same column. COUNTIFS compares text to text and numbers to numbers; mismatches silently fail. Coerce with VALUE or TEXT as needed.
- Forgetting to lock the criteria range when copying formulas—an accidental shift can reference an empty column and return zero.
- Overlooking trailing spaces in source data. \"Apple \" and \"Apple\" are different strings. Use TRIM on import or apply CLEAN/TRIM in helper columns.
- Ignoring blanks if they should be excluded. Add an explicit
"<>"&""criterion pair to omit empty cells.
Alternative Methods
| Method | Pros | Cons | Best When |
|---|---|---|---|
| COUNTIFS multiple pairs | Fast, easy, up to 127 exclusions, Table-friendly | Requires one pair per exclusion, not ideal for dynamic list longer than 127 | A handful of exclusions, older Excel versions |
| SUMPRODUCT + ISNA(MATCH) | Unlimited exclusions, works in Excel 2010+ | More CPU-intensive, syntax harder for beginners | Variable exclusion list stored in a column |
| FILTER + COUNTA (365) | Dynamic spills, fastest recalc, fewest helper columns | Requires Office 365, FILTER returns error when result is empty | Modern Excel, dashboards with dynamic lists |
| PivotTable with Report Filter | GUI-based, no formulas, interactive | Manual refresh, harder to embed in calculations | Presentation layer, ad-hoc analysis |
| Power Query | Handles millions of rows, refreshes from database | Not real-time in worksheet, learning curve | ETL pipelines, scheduled reports |
Migration tip: Start with COUNTIFS. If your exclusion list grows or becomes dynamic, convert to SUMPRODUCT or FILTER by referencing the same range.
FAQ
When should I use this approach?
Use it any time you need a rapid aggregate of records excluding defined values—open tickets, active SKUs, qualified leads, or valid survey answers.
Can this work across multiple sheets?
Yes. Reference the data range on one sheet and the exclusion list on another: =COUNTIFS(Sheet1!B:B,"<>"&Sheet2!A2, …). For SUMPRODUCT/MATCH, qualify both ranges fully.
What are the limitations?
COUNTIFS caps you at 127 criteria pairs. All criteria must refer to ranges of equal length. It is also not case-sensitive.
How do I handle errors?
Wrap dynamic array approaches with IFERROR to return zero when everything is excluded. For SUMPRODUCT, ensure ranges are the same size; otherwise, you will receive a #VALUE! error.
Does this work in older Excel versions?
COUNTIFS is available starting Excel 2007. SUMPRODUCT works in all modern versions. FILTER requires Office 365: for Excel 2010-2019, use SUMPRODUCT or helper columns.
What about performance with large datasets?
- COUNTIFS on 100 000 rows is near-instant.
- SUMPRODUCT may slow down past 200 000 rows; limit recalculation or switch to FILTER.
- For millions of rows, offload to Power Query or a database engine.
Conclusion
Learning to count records that are not equal to multiple criteria unlocks cleaner reporting and sharper decision-making. With COUNTIFS you solve 90 percent of cases quickly; SUMPRODUCT and FILTER extend your reach to dynamic or very large exclusion lists. Add these techniques to your arsenal, test carefully, and you will slice through data noise with confidence. To advance, practice converting manual filters to formulas and explore Power Query for enterprise-scale exclusion logic. Happy counting!
Related Articles
How to Show the 10 Most Common Text Values in Excel
Learn multiple Excel methods to list the 10 most frequent text values—complete with step-by-step examples, business use cases, and expert tips.
How to Abbreviate Names Or Words in Excel
Learn multiple Excel methods to abbreviate names or words with step-by-step examples and practical applications.
How to Abbreviate State Names in Excel
Learn multiple Excel methods to abbreviate state names with step-by-step examples, professional tips, and real-world applications.