ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. COUNTIF With Multiple Values (OR Logic)

COUNTIF With Multiple Values (OR Logic)

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

To count cells that match any of several values, add one COUNTIF per value: =COUNTIF(C2:C9,"Open")+COUNTIF(C2:C9,"Pending"). A shorter version puts the values in curly brackets and wraps the result in SUM: =SUM(COUNTIF(C2:C9,{"Open","Pending"})). If the values are in cells, use =SUMPRODUCT(COUNTIF(C2:C9,F2:F3)). Don't use COUNTIFS, which needs every condition to be true.

Key takeaways

  • COUNTIF checks one value. For OR logic, add one COUNTIF per value.
  • =SUM(COUNTIF(range,{"A","B"})) counts several values in one short formula.
  • For a list of values in cells, use SUMPRODUCT(COUNTIF(range,list)).
  • COUNTIFS on the same column with two values returns 0, because it means AND.
  • Overlapping wildcards can count a cell twice; test each row once with SEARCH instead.
On this page+
  1. The sample data
  2. How to COUNTIF multiple values by adding COUNTIFs
  3. A shorter way: COUNTIF with an array of values
  4. How to count values listed in cells
  5. Why COUNTIFS returns 0 for multiple values
  6. How to count multiple values with wildcards
  7. How to count OR conditions across two columns
  8. Which method should you use?
  9. Practise it

COUNTIF takes only one condition, so to count cells that match multiple values, such as Open or Pending, you combine COUNTIFs. The simplest way is to add them together; a shorter way puts the values in an array inside one COUNTIF. This guide shows both, plus how to use a list of values in cells and how to avoid counting the same cell twice.

The sample data#

Every example uses this list of support tickets in A1:C9:

ABC
1TicketCategoryStatus
2T-01BillingOpen
3T-02LoginClosed
4T-03BillingPending
5T-04ShippingOpen
6T-05LoginEscalated
7T-06RefundClosed
8T-07ShippingPending
9T-08BillingOpen

There are 3 Open, 2 Pending, 2 Closed and 1 Escalated ticket. If you're new to the function, start with the COUNTIF guide or the short COUNTIF function reference.

How to COUNTIF multiple values by adding COUNTIFs#

Write one COUNTIF for each value and add the results with +. To count tickets that are Open or Pending:

Excel formula
=COUNTIF(C2:C9,"Open")+COUNTIF(C2:C9,"Pending")

The result is 5 (3 + 2). This works in every version of Excel and is easy to read. Each cell holds only one status, so no ticket is counted twice.

The downside is length. With four or five values, the formula gets long and it is easy to miss a range when you edit it.

A shorter way: COUNTIF with an array of values#

Put the values inside curly brackets, separated by commas, and wrap COUNTIF in SUM:

Excel formula
=SUM(COUNTIF(C2:C9,{"Open","Pending"}))

The result is again 5. The curly brackets make an array constant, a fixed list of values typed into the formula. COUNTIF runs once for each value and returns two counts, {3,2}. SUM then adds them up.

Without SUM, older versions of Excel show only the first count, 3. In Microsoft 365 the two counts spill into two cells instead. So always keep the SUM. You type the curly brackets yourself; this formula needs no special keys.

How to count values listed in cells#

When the values to count sit in cells, point COUNTIF at that range and wrap it in SUMPRODUCT. Say F2:F3 hold Open and Pending:

Excel formula
=SUMPRODUCT(COUNTIF(C2:C9,F2:F3))

The result is 5. Now you can change the list without touching the formula, and adding a third value only means extending the range to F2:F4.

=SUM(COUNTIF(C2:C9,F2:F3)) also works in Microsoft 365 and Excel 2021. In Excel 2019 and older it must be confirmed with Ctrl+Shift+Enter as an array formula, which is easy to forget. SUMPRODUCT works everywhere with a normal Enter.

Why COUNTIFS returns 0 for multiple values#

COUNTIFS uses AND logic: a row counts only if every condition is true. So this returns 0:

Excel formula
=COUNTIFS(C2:C9,"Open",C2:C9,"Pending")

No cell can be Open and Pending at the same time. This is one of the most common reasons for a surprise zero, along with the others in why COUNTIF is not working.

AND logic is useful for exclusions, though. To count tickets that are neither Closed nor Escalated:

Excel formula
=COUNTIFS(C2:C9,"<>Closed",C2:C9,"<>Escalated")

The result is 5: every ticket except T-02, T-05 and T-06. The same pattern counts numbers in a band, such as ">=10" and "<=20"; see COUNTIF greater than and less than.

How to count multiple values with wildcards#

Wildcards work inside the array too. To count categories that start with B or S:

Excel formula
=SUM(COUNTIF(B2:B9,{"B*","S*"}))

The result is 5 (3 Billing + 2 Shipping). The * matches any characters after the letter. The lesson on wildcards and cell-based criteria covers * and ? in detail.

Be careful when the patterns can overlap. =SUM(COUNTIF(B2:B9,{"*bill*","*ing*"})) returns 8, not 5. Every Billing cell matches both patterns, so each one is counted twice.

To count each row once, test every cell with SEARCH and count the rows where at least one test is true:

Excel formula
=SUMPRODUCT(--((ISNUMBER(SEARCH("bill",B2:B9))+ISNUMBER(SEARCH("ing",B2:B9)))>0))

This returns 5. SEARCH finds the text anywhere in the cell, ISNUMBER turns a match into TRUE, and >0 keeps any row with at least one match. More on partial matches in COUNTIF contains text.

How to count OR conditions across two columns#

When the two values are in different columns, adding COUNTIFs can count a row twice. To count tickets that are Billing or Open, subtract the rows that are both:

Excel formula
=COUNTIF(B2:B9,"Billing")+COUNTIF(C2:C9,"Open")-COUNTIFS(B2:B9,"Billing",C2:C9,"Open")

That is 3 + 3 - 2 = 4 (T-01, T-03, T-04 and T-08). Without the subtraction, T-01 and T-08 would each be counted twice. If you need how many different values there are, rather than how many matches, see how to count unique values.

Which method should you use?#

Pick the method by where the values live and how many there are. All four give the same count on clean data.

SituationFormula patternWorks in
Two or three fixed valuesCOUNTIF(...)+COUNTIF(...)Every version
Several fixed valuesSUM(COUNTIF(range,{"A","B","C"}))Every version
Values listed in cellsSUMPRODUCT(COUNTIF(range,list))Every version
Patterns that can overlapSUMPRODUCT(--((ISNUMBER(SEARCH(...))+...)>0))Every version

For a job test, the added COUNTIFs are the safest answer, because anyone checking your work can read them at a glance. In your own reports, a list of values in cells is easier to maintain: when a manager asks to add "Escalated" to the count, you type one word in a cell instead of editing the formula. Whatever you choose, check the result once by hand on a small range before you trust it on thousands of rows.

Practise it#

OR counts come up often in reports and job tests. Practise COUNTIF in a live spreadsheet: you type each formula and the lesson checks it instantly. Then practise wildcards and cell-based criteria to count partial matches and values from a list.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

How many tickets are Open or Pending? Click F2 and count both values in the Status column (C2:C9) with one formula.

fx
ABCDEFG
1
Ticket
Category
Status
2
T-01
Billing
Open
Open or Pending
3
T-02
Login
Closed
4
T-03
Billing
Pending
5
T-04
Shipping
Open
6
T-05
Login
Escalated
7
T-06
Refund
Closed
8
T-07
Shipping
Pending
9
T-08
Billing
Open
10
11
12

Tip: Write one COUNTIF for Open, one for Pending, and add them with +.

Practise this in a lesson

LessonCOUNTIFCount the cells that match a condition, from exact words to number checks like ">=8".LessonWildcards and cell-based criteriaMatch partial text with * and ?, and build criteria from cells like ">"&H5 so your formulas adapt.Function guideCOUNTIFCount cells that match one condition with COUNTIF: text, numbers, wildcards and cell references. Real examples and a live exercise.

Frequently asked questions

Can COUNTIF have multiple criteria?

+

Not directly; COUNTIF takes one criteria. For OR logic, add several COUNTIFs or use =SUM(COUNTIF(range,{"A","B"})). For AND logic across columns, use COUNTIFS.

How do I count cells that equal one value or another?

+

Add two COUNTIFs on the same range: =COUNTIF(C2:C9,"Open")+COUNTIF(C2:C9,"Pending"). Each cell can only hold one of the values, so nothing is counted twice.

Why does COUNTIFS return 0 with two values in the same column?

+

COUNTIFS counts rows where every condition is true. A cell can't be Open and Pending at the same time, so the answer is 0. Use COUNTIF with OR logic instead.

How do I count cells that are not equal to several values?

+

Use COUNTIFS with one not-equal condition per value on the same range: =COUNTIFS(C2:C9,"<>Closed",C2:C9,"<>Escalated"). Here AND logic is exactly what you want.

Sources

  • COUNTIF function - Microsoft Support
  • COUNTIFS function - Microsoft Support
  • SUMPRODUCT function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. The sample data
  2. How to COUNTIF multiple values by adding COUNTIFs
  3. A shorter way: COUNTIF with an array of values
  4. How to count values listed in cells
  5. Why COUNTIFS returns 0 for multiple values
  6. How to count multiple values with wildcards
  7. How to count OR conditions across two columns
  8. Which method should you use?
  9. Practise it

Keep reading

Conditional math· 6 min read

COUNTIF Contains Text: Count Partial Matches

To count cells that contain a word anywhere in the text, put asterisks around it: =COUNTIF(A2:A8,"*blue*"). The * wildcard stands for any number of characters, so the formula counts "Blue Jeans", "Navy Blue Jacket" and "Light blue Cap". For a word in a cell, use "*"&E1&"*". COUNTIF ignores capitals.

Errors & fixes· 5 min read

COUNTIF Not Working? Common Causes and Fixes

COUNTIF usually returns 0 or a low count because the criteria doesn't match the cells exactly. The most common causes are extra spaces in the data, numbers stored as text, missing quotes around text or operators, and a cell reference typed inside quotes. Clean the data with TRIM, write criteria like ">="&E1, and use wildcards for partial matches.

Conditional math· 6 min read

How to Count Unique Values in Excel

In Excel 2021 and Microsoft 365, count unique values with =COUNTA(UNIQUE(B2:B11)): UNIQUE lists each different value once and COUNTA counts the list. Add a condition with FILTER, as in =COUNTA(UNIQUE(FILTER(B2:B11,C2:C11="East"))). In older Excel, use =SUMPRODUCT(1/COUNTIF(B2:B11,B2:B11)) instead.

More on conditional math

  • Count Non-Blank Cells With a Condition in Excel
  • COUNTIF Not Equal To: Count Cells That Don't Match
  • How to Calculate a Percentage With COUNTIF in Excel
  • COUNTIFS With a Date Range in Excel
  • COUNTIFS and SUMIFS: Multiple Conditions in Excel
  • MAXIFS and MINIFS: Highest and Lowest With Conditions
All conditional math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free