FORMULAS & FUNCTIONS

COUNTIFS with Multiple Criteria in the Same Column (OR Logic)

You want to count tasks that are Not Started or In Progress, so you write a COUNTIFS with both statuses, and Excel returns 0. This tutorial explains why, then shows the formula that works, how to combine it with other criteria, how to keep the criteria in cells, and how to prove the count with a second formula.

Excel COUNTIFS with multiple criteria in the same column: 11 tasks are Not Started or In Progress, 5 of them High priority, with criteria in cells and a SUMPRODUCT check.
The finished result: OR logic in one column, combined with AND on other columns.

What you will build

Brightline Trading Co. tracks 20 client tasks. Each task has an owner, a status (Not Started, In Progress, On Hold, Done or Cancelled), a priority and an hours estimate. The question: how many tasks are still open, meaning Not Started or In Progress? Both values live in the same Status column.

AreaCellsWhat it holds
Task listA3:F24Task, Client, Owner, Status, Priority and Hours (inputs), with a total row
ResultsH2:I13Ten COUNTIFS and SUMIFS examples and a check cell
Status listH15:H17The statuses to count, typed in cells (inputs)
Free download: Get the COUNTIFS same-column workbook (.xlsx) and follow along. Yellow cells are inputs, and every formula below is already in place. It works in Excel 2010 and later, Microsoft 365 and Excel for the web.

Step 1: Look at the data and the question

  1. Put the task list in A3:F23 with the headers Task, Client, Owner, Status, Priority and Hours, one task per row.
  2. In H2:I2 add the headers Question and Count. Each row below asks one question in column H and answers it in column I.
  3. Make sure the statuses are spelled the same way every time. A drop-down list (Data > Data Validation > List) is the easiest way.
Excel task list of 20 client tasks with Task, Client, Owner, Status, Priority and Hours columns; the Status column is highlighted.
Twenty tasks; the two statuses we want are both in column D.
StatusTasks
Not Started5
In Progress6
On Hold2
Done5
Cancelled2
Total20
So the answer we are looking for is 5 + 6 = 11.

Step 2: Why two criteria on the same column return 0

The first thing most people try is in I3:

=COUNTIFS($D$4:$D$23,"Not Started",$D$4:$D$23,"In Progress")

COUNTIFS counts a row only when every condition is true. This formula asks for rows where the status is Not Started and In Progress at the same time. A cell holds one value, so no row qualifies.

Excel formula =COUNTIFS($D$4:$D$23,"Not Started",$D$4:$D$23,"In Progress") returning 0 because COUNTIFS joins criteria with AND.
COUNTIFS joins its conditions with AND, so this returns 0.
Watch out: This is not an error message, it is a wrong answer. A 0 looks believable, so it can go straight into a report. Whenever a COUNTIFS uses the same range twice with two different exact values, it is the AND trap.

Step 3: OR in one column with an array constant

Give COUNTIFS both statuses at once, in curly braces, and wrap it in SUM. In I4:

=SUM(COUNTIFS($D$4:$D$23,{"Not Started","In Progress"}))
  • {"Not Started","In Progress"} is an array constant: a list typed straight into the formula.
  • COUNTIFS runs once for each item and returns two counts, {5,6}.
  • SUM adds them: 11. Type it normally; array constants do not need Ctrl+Shift+Enter in any version.

For two or three values, writing the COUNTIFS out and adding them gives the same answer and is easy to read. In I5:

=COUNTIFS($D$4:$D$23,"Not Started")+COUNTIFS($D$4:$D$23,"In Progress")
Excel formula =SUM(COUNTIFS($D$4:$D$23,{"Not Started","In Progress"})) returning 11, matching two COUNTIFS added together.
The array version and the added version agree on 11.
Checkpoint: I4 and I5 should both show 11. The array version is shorter once you have four or five values, because you only add an item to the list.

Step 4: Combine OR with AND on other columns

Everything after the array is a normal AND condition. To count open tasks that are also High priority, in I6:

=SUM(COUNTIFS($D$4:$D$23,{"Not Started","In Progress"},$E$4:$E$23,"High"))

That returns 5: T-102, T-107, T-110, T-115 and T-119. You can also use a second OR list on a different column. For open tasks owned by Ana or Ben, in I7:

=SUM(COUNTIFS($D$4:$D$23,{"Not Started","In Progress"},$C$4:$C$23,{"Ana";"Ben"}))

The first list uses a comma (it runs across) and the second uses a semicolon (it runs down). Excel pairs every status with every owner, so it counts all four combinations and SUM adds them: 8. If both lists used commas, Excel would pair them item by item (Not Started with Ana, In Progress with Ben) and miss the other two combinations.

Excel formula =SUM(COUNTIFS($D$4:$D$23,{"Not Started","In Progress"},$C$4:$C$23,{"Ana";"Ben"})) returning 8, and the High priority version returning 5.
Comma across, semicolon down: four status/owner pairs in one formula.
Checkpoint: I6 should show 5 and I7 should show 8. Only Carla's three open tasks are left out of I7.

Step 5: Keep the criteria in cells, and count number ranges

Hard-coded lists are fine for a quick answer, but a report is easier to change when the criteria live in cells. Type Not Started in H16 and In Progress in H17, then in I8:

=SUMPRODUCT(COUNTIFS($D$4:$D$23,H16:H17))

SUMPRODUCT does the same job as SUM here, but it handles a cell range without Ctrl+Shift+Enter in Excel 2019 and earlier. In Microsoft 365, =SUM(COUNTIFS($D$4:$D$23,H16:H17)) also works.

Two criteria on the same column are not always wrong. For a range of numbers, AND is exactly what you want. Tasks estimated at 10 to 20 hours, in I9:

=COUNTIFS($F$4:$F$23,">=10",$F$4:$F$23,"<=20")
Excel formula =SUMPRODUCT(COUNTIFS($D$4:$D$23,H16:H17)) returning 11 with the statuses typed in H16:H17, and a hours from 10 to 20 count of 10.
Criteria in H16:H17 feed the formula in I8; a number range uses AND on one column.
Checkpoint: I8 should show 11 and I9 should show 10. A value can be at least 10 and at most 20 at the same time, so AND works; it cannot be two different statuses at once.

The same ideas carry over. =SUM(SUMIFS($F$4:$F$23,$D$4:$D$23,{"Not Started","In Progress"})) in I11 adds the hours on open tasks: 148. And exclusions on the same column do work as AND: =COUNTIFS($D$4:$D$23,"<>Done",$D$4:$D$23,"<>Cancelled") in I12 returns 13, the 11 open tasks plus the 2 on hold.

Step 6: Verify the count with SUMPRODUCT

A second formula that works in a different way is the best check. In I10:

=SUMPRODUCT(--((($D$4:$D$23="Not Started")+($D$4:$D$23="In Progress"))>0))

Each comparison returns TRUE or FALSE for every row. Adding them gives 1 for a row that matches either status and 0 otherwise; >0 and -- turn that into a 1 or 0 per row, and SUMPRODUCT adds them up. In I13, =IF(AND(I4=I5,I4=I10),"Ties","Check") confirms the three methods agree.

Excel SUMPRODUCT check returning 11, the same as COUNTIFS, with the status cell showing Ties.
SUMPRODUCT, the array COUNTIFS and the added COUNTIFS all return 11.
Ready-to-share test: Change H17 to On Hold. I8 becomes 7 (5 Not Started plus 2 On Hold), while I4 still shows 11 and I13 still shows Ties, because the hard-coded formulas did not change. Change H17 back to In Progress when you are done.
Double-counting: SUM(COUNTIFS(…)) only works when the values cannot both be true for the same row, like two statuses in one column. For an OR across two different columns, such as Status is Not Started or Priority is High, a task that meets both would be counted twice. Use =SUMPRODUCT(--((($D$4:$D$23="Not Started")+($E$4:$E$23="High"))>0)) instead.

Where you will use this

Status counts are the backbone of any tracker. In a project tracker with status and due dates, this formula counts open work; in a sales pipeline tracker, it counts deals in any of several stages. Combine it with a date condition to count overdue items with COUNTIFS, or switch to SUMIFS to total amounts the same way, as in SUMIFS between two dates. In an accounts receivable aging report, the same pattern counts invoices in the 61-90 or 90+ buckets together. To list the matching rows instead of counting them, use the FILTER function.

Common mistakes and quick fixes

What you seeLikely causeFix
Result is 0Two exact values on the same column are joined with ANDUse SUM(COUNTIFS(range,{“A”,”B”})).
Result is only the first countThe SUM around COUNTIFS is missingWrap the COUNTIFS in SUM or SUMPRODUCT.
Two OR lists miss combinationsBoth lists use commasUse a comma in one list and a semicolon in the other.
Count is too highOR across two different columns double-countsUse SUMPRODUCT with ((test1)+(test2)>0).
A status is not countedExtra spaces or a different spellingUse a drop-down list, or clean the column with TRIM.
Numbers are not countedThey are stored as textFix numbers stored as text, then recount.

Frequently asked questions

Can COUNTIFS do OR logic?

Not by itself. COUNTIFS always joins its conditions with AND. You get OR by giving it a list of values, such as {“Not Started”,”In Progress”}, and adding the counts with SUM or SUMPRODUCT.

How many values can I put in the list?

As many as you need: =SUM(COUNTIFS(D4:D23,{“A”,”B”,”C”,”D”})). Once the list gets long, keep it in cells and use SUMPRODUCT(COUNTIFS(D4:D23,H16:H19)).

Can I use wildcards in the list?

Yes. COUNTIFS accepts * and ? inside each item, so {“*Cafe”,”*Fitness”} counts clients ending in either word. Make sure no value can match two patterns, or it will be counted twice.

Does this work in Google Sheets?

Yes. In Google Sheets, wrap it in SUM or use ARRAYFORMULA if it returns only the first count: =SUM(ARRAYFORMULA(COUNTIFS(D4:D23,{“Not Started”,”In Progress”}))).

Why not just count everything except Done and Cancelled?

You can, with =COUNTIFS(D4:D23,”<>Done”,D4:D23,”<>Cancelled”), but it also counts On Hold and any new status someone adds later. Listing the statuses you want is safer for a report.

Final checklist

  • Two exact values on the same column use an array constant and SUM, not two criteria pairs.
  • Extra AND conditions are added as normal range/criteria pairs.
  • A second OR list on another column uses a semicolon.
  • Criteria in cells use SUMPRODUCT for older Excel versions.
  • OR across different columns uses SUMPRODUCT so rows are not double-counted.
  • A SUMPRODUCT check agrees with the COUNTIFS result.

Once OR logic clicks, the same pattern works in SUMIFS and AVERAGEIFS. SUMIFS between two dates and gross margin vs markup are good next steps.

Practice file: Download the COUNTIFS same-column workbook. The “How It Works” sheet lists every formula and what it does.

Count anything, any way you need

Browse the OneXcel Tutorial Hub for more formula guides, explore ready-to-use Excel templates, or turn your status counts into a dashboard with the OneXcel Dashboard Builder.

Discover more from OneXcel Studio

Subscribe now to keep reading and get access to the full archive.

Continue reading