COUNTIFS With Multiple Criteria in Excel, and Why It Returns 0
Count rows with COUNTIFS on several criteria, a date range, OR logic and blank cells, compare two columns with SUMPRODUCT, and fix a COUNTIFS that returns 0.
- Excel
- Formulas
- Data Quality

On this page
- How does COUNTIFS work with multiple criteria?
- How do you count between two dates with COUNTIFS?
- How do you count with OR logic in COUNTIFS?
- How do you count blank or non-blank cells?
- How do you count rows where one column is greater than another?
- Why does COUNTIFS return 0?
- Does COUNTIFS work the same in Google Sheets?
- Where does Glow Reports fit?
- Common questions
You exported your invoices and want to know how many are paid in the North region, how many were issued in March, or how many were paid late. COUNTIFS counts the rows that meet every condition you give it: . It gets tricky with dates, with "this or that", and with conditions that compare two columns. Then it returns 0 and nothing on the sheet says why. This guide covers each case on one sample export, then the causes of a wrong count.
How does COUNTIFS work with multiple criteria?
COUNTIFS takes pairs of a range and a condition and counts the rows where every pair is true at once. You can add up to 127 pairs, and each range must have the same number of rows and columns as the first Microsoft Support.
Here is the sample used in this guide, an invoice export. Type it in A1:F11.
| Invoice | Issued | Region | Status | Due | Paid |
|---|---|---|---|---|---|
| INV-101 | 2026-02-24 | North | Paid | 2026-03-26 | 2026-03-20 |
| INV-102 | 2026-03-02 | South | Paid | 2026-04-01 | 2026-04-09 |
| INV-103 | 2026-03-05 | North | Open | 2026-04-04 | |
| INV-104 | 2026-03-11 | North | Paid | 2026-04-10 | 2026-04-22 |
| INV-105 | 2026-03-14 | South | Disputed | 2026-04-13 | |
| INV-106 | 2026-03-19 | North | Paid | 2026-04-18 | 2026-04-15 |
| INV-107 | 2026-03-27 | South | Open | 2026-04-26 | |
| INV-108 | 2026-03-31 | North | Disputed | 2026-04-30 | |
| INV-109 | 2026-04-02 | South | Paid | 2026-05-02 | 2026-05-12 |
| INV-110 | 2026-04-08 | North | Paid | 2026-05-08 | 2026-05-06 |
Paid invoices in the North:
=COUNTIFS(C2:C11,"North",D2:D11,"Paid")Put the conditions in cells to reuse the formula. With "North" in H2 and "Paid" in I2, returns the same 4. Text conditions ignore case, so "north" matches too. Wildcards work on text: matches any region that starts with N.
COUNTIF, without the S, takes a single range and a single condition. COUNTIFS does everything COUNTIF does, so there is no reason to switch between the two.
How do you count between two dates with COUNTIFS?
Use the same date column twice, once with and the start date, once with and the day after the end. Build the dates with DATE so the formula reads the same in every regional setting.
=COUNTIFS(B2:B11,">="&DATE(2026,3,1),B2:B11,"<"&DATE(2026,4,1))The operator sits in quotes and the date joins it with . Writing inside the quotes also works on a US setup, but a sheet set to day-first dates reads it as 3 January. Microsoft's own example uses that form, which is why it fails for many readers outside the US.
Use with the first day of the next month, not with the last day. An export with timestamps stores 31 March at 14:20 as a value above 31 March. If INV-108 carried that time, would drop it and count 6. Add the region as a third pair to get March invoices in the North, which returns 4.
How do you count with OR logic in COUNTIFS?
Add one COUNTIFS per value. All conditions inside one COUNTIFS combine with AND, so a status can't be "Open" and "Disputed" on the same row.
=COUNTIFS(D2:D11,"Open")+COUNTIFS(D2:D11,"Disputed")In Excel, a shorter form passes both values as an array and sums the two counts: Exceljet. Keep the other conditions in each part. Open or disputed invoices in the North are , which returns 2.
Only add counts for values that can't overlap. Two conditions on different columns, such as "North or Disputed", count a North disputed invoice twice. For those, add the tests inside SUMPRODUCT and keep the rows where at least one is true: returns 7, where two COUNTIFS would return 8.
How do you count blank or non-blank cells?
Use for cells that hold something and for empty cells. counts the invoices with a payment date, 6 on the sample. counts the 4 without one.
Combine it with other pairs. Unpaid invoices due before 15 April:
=COUNTIFS(F2:F11,"",E2:E11,"<"&DATE(2026,4,15))Microsoft notes one trap: when a condition points to an empty cell, COUNTIFS reads it as 0 Microsoft Support. A formula with H2 as its condition and H2 left blank counts zeros, not blanks. Write in the formula when you mean blank.
How do you count rows where one column is greater than another?
COUNTIFS can't do it. Its condition compares a range with one value, not each row with another cell on the same row. Counting invoices paid after their due date needs SUMPRODUCT, which multiplies the tests row by row and adds the results Microsoft Support.
=SUMPRODUCT((F2:F11<>"")*(F2:F11>E2:E11))Each test returns TRUE or FALSE per row, and the multiplication turns them into 1 and 0. The first test keeps only paid invoices, the second compares the payment date with the due date on the same row. The sample counts INV-102, INV-104 and INV-109. Add more tests in the same way, such as , which brings the count to 1.
This is the situation a Microsoft Tech Community member hit when trying to count overdue deliveries with COUNTIFS, and the answer there was the same switch to SUMPRODUCT. A helper column with and a COUNTIFS on it gives the same 3 and is easier to read for whoever opens the file next. The AR aging guide goes further with due dates, grouping open invoices into age buckets.
Why does COUNTIFS return 0?
Because no row meets every condition at once, or because Excel doesn't see the values the way you do. Test each pair on its own: the pair that returns 0 holds the problem. These are the usual causes:
- Dates stored as text. An export can bring dates in as text that looks right. A date condition never matches text. returns FALSE on a text date. The text to date guide shows how to convert the column.
- Numbers stored as text. An ID or a code imported as text doesn't match a numeric condition. Convert the column, or compare text with text.
- Spaces and stray characters. "Paid " with a trailing space is not "Paid". Microsoft lists leading spaces, trailing spaces, curly quotes and nonprinting characters as causes of wrong counts Microsoft Support. in a helper column fixes most of them.
- A date typed in the wrong order. on a day-first setup means 3 January. Use DATE.
- The operator outside the quotes. without quotes and is a syntax error or a TRUE/FALSE test. Write .
A #VALUE! error points elsewhere. Either the ranges have different sizes, such as with , or the formula points to another workbook that is closed. Open that workbook, or bring the data into the same file.
Does COUNTIFS work the same in Google Sheets?
Yes. COUNTIFS in Google Sheets takes the same range and condition pairs, the same operators in quotes and the same wildcards Google Docs Editors Help. The date range with DATE, the blank test with and the SUMPRODUCT formula for late payments all work unchanged.
For OR logic, adding two COUNTIFS works in both tools and is the easiest to read. To count distinct customers rather than rows, see the count unique values guide. To add up amounts with the same conditions, the SUMIFS guide uses the same pairs.
Where does Glow Reports fit?
One COUNTIFS is quick. A report is a dozen of them: counts by region, by status and by month, late payments, the share of disputed invoices, each one rebuilt when a new export arrives, with the text dates and trailing spaces fixed again first.
With Glow Reports, you upload the CSV or Excel export and ask in plain language, such as the number of invoices by region and status for March, and how many were paid after their due date. A CSV upload detects its separator, comma, semicolon or tab. The AI writes the SQL, builds the charts and drafts the text. The SQL sits under each figure, so you can check each condition and edit the query when a count looks off. Reports export to PDF and stay in the workspace. The free plan gives 300 credits once, and a report costs 100 credits.
Common questions
How do I use COUNTIFS with multiple criteria in Excel?
Give COUNTIFS one range and one condition per criterion: . It counts the rows where all conditions are true. Every range must cover the same rows.
How do I count between two dates in Excel?
Use the date column twice: . The first day of the next month with keeps rows with a time on the last day.
Can COUNTIFS use OR instead of AND?
Not inside one formula. Add one COUNTIFS per value, or in Excel use . Make sure the values can't both be true on the same row.
What is the difference between COUNTIF and COUNTIFS?
COUNTIF takes one range and one condition. COUNTIFS takes up to 127 pairs and counts rows that meet all of them. COUNTIFS with a single pair gives the same result as COUNTIF.
I am a product engineer and the founder of Glow Reports. I spent more than 6 years building products in tech, data and cybersecurity, for large groups, startups and SMEs. In most organizations I saw data treated as a technical topic, when it drives business decisions. I built the reporting tool I was looking for, so the people who run small and mid-sized organizations can read their own numbers without a data team.
More from El Mehdi BenaneUpload your invoice export to Glow Reports and ask for counts by region, status and month, with the SQL behind each figure.


