Contact

COUNTIFS Function in Microsoft Excel: Formula, Examples & Troubleshooting

Statistical Intermediate Microsoft Excel

Learn the COUNTIFS formula in Microsoft Excel: count rows meeting multiple aligned conditions, with reproducible examples, expected answers and compatibility cautions.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: Use COUNTIFS to count rows meeting multiple aligned conditions. The example below supplies exact inputs and independently calculated expected results, so you can check your formula before replacing the demonstration values with real workbook data.

Verification: The function is covered by a vendor reference or its published formula catalogue. The worked outputs here are independently reasoned, not screenshots or native test results from Microsoft Excel. Check release-specific support and argument details in the referenced vendor help.

Availability and version history

  • Introduced: Microsoft documents availability starting with Excel 2007; an exact first build or launch date is not established here. Microsoft historical guidance.
  • Availability: Official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016, Excel Web App.
  • Checked: October 14, 2026; official COUNTIFS reference. Documentation check, not a new native test; existing example-verification notes retain their scope.

Syntax and arguments

=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Supply range/condition pairs; all pairs must describe corresponding cells. In formula syntax, square brackets mark optional arguments; do not type square brackets into an ordinary formula unless the particular function requires array notation. The separator shown is for the example locale and might change with spreadsheet settings.

When to use it: Put date boundaries in separate criteria when counting a period.

Prepare the example inputs

In an Excel workbook, format the amount and units cells as numbers before entering the formula. Use the Name Box to check the addressed cell range if the displayed value differs.

For the formulas that reference cells, enter this small dataset into A1:F9 (the first row contains headings). The Amount and Units columns are numbers; the team, status, item and agent columns are text. Keep the calculation cell outside A1:F9 so it cannot overwrite an input.

Row A · Item B · Team C · Status D · Amount E · Units F · Agent
1 Item Team Status Amount Units Agent
2 Pen East Paid 120 12 Ana
3 Pad West Pending 75 5 Bo
4 Box East Paid 210 7 Ana
5 Tape North Paid 90 0 Cy
6 Folder West Paid 150 3 Bo
7 Pen East Pending 60 8 Dee
8 Pad West Paid 125 12 Ana
9 Box North Pending 80 4 Cy

Worked example: exact formula and expected output

=COUNTIFS(B2:B9,"East",C2:C9,"Paid")

Expected result: 2. Rows 2 and 4 are both East and Paid.

  1. Select an unused output cell (for example H2 if the practice table occupies A1:F9).
  2. Enter the formula exactly as shown, including the opening equals sign and quoted text.
  3. Compare the displayed answer to the expected result, then inspect the source cells if it differs.

For a range formula, the row numbers include data rows only unless the example explicitly refers to headers. A result that looks plausible may still be wrong if it references the wrong column.

Second example: a different input

=COUNTIFS(B2:B9,"West",D2:D9,">=100")

Expected result: 2. Two West orders have amounts at least 100: rows 6 and 8.

This second check uses the same function with a different input, helping you identify whether the first result was coincidental or caused by a shifted reference.

Multiple criteria count corresponding positions, not independent totals

Excel allows up to 127 range/criterion pairs. Each additional range must have the same number of rows and columns as the first; the ranges do not need to be adjacent. Every position contributes at most one to the count when all its conditions hold.

A quick alignment control uses H2:H3 containing East, West and I2:I3 containing Paid, Pending. =COUNTIFS(H2:H3,"East",I2:I3,"Paid") has expected result 1. Reversing only the status values changes it to 0. Both ranges still have the correct dimensions, but the row associations have changed.

Advanced example: count a bounded amount interval

=COUNTIFS(D2:D9,">=100",D2:D9,"<150")

Expected result: 2, for amounts 120 and 125. Using “<=150” instead produces 3 by admitting the boundary value 150. Test both endpoints deliberately rather than relying on a verbal phrase such as between 100 and 150.

Enter numeric 100 in H6 and 150 in H7 to make the bounds editable:

=COUNTIFS(D2:D9,">="&H6,D2:D9,"<"&H7)

The expected result remains two. Each condition needs its own range/criterion pair even when both conditions concern the same cells.

Advanced example: count completed records with positive quantities

=COUNTIFS(C2:C9,"Paid",E2:E9,">0")

Expected result: 4. There are five Paid records, but the North/Paid row with zero Units fails the positive-quantity condition. Counting Paid labels alone would answer a broader question.

To add an amount condition, append D2:D9,">=100". For this dataset the expected count remains 4, but that agreement depends on these rows; it is not proof that the extra condition is redundant for future data.

Advanced example: text patterns still combine with AND

=COUNTIFS(A2:A9,"P*",C2:C9,"Paid")

Expected result: 2, for the Paid Pen and Paid Pad rows. The other two P-prefixed Item records are Pending. Microsoft documents * as a sequence wildcard, ? as a single-character wildcard, and ~ as an escape before a literal wildcard.

Adding Team equals East and Team equals West in the same formula would demand both labels at once. It is not an OR selector. Pattern and equality criteria must each describe the intended record population.

Advanced example: express an inclusive OR explicitly

East has three rows, Paid has five and their intersection has two. Thus:

=COUNTIF(B2:B9,"East")+COUNTIF(C2:C9,"Paid")-COUNTIFS(B2:B9,"East",C2:C9,"Paid")

Expected result: 6. The sum without subtraction is eight because the two East/Paid records are counted twice. For mutually exclusive East and West labels, the corresponding two COUNTIF counts may be added directly and also produce six.

The fact that two different selection rules yield six here does not make them equivalent. East-or-West selects different records from East-or-Paid, which matters when the count later drives a sum or a lookup.

Empty criterion references and boundary scope

Microsoft states that an empty cell used as the criterion reference is treated as numeric zero. That is distinct from an intentionally supplied blank-text criterion. A cleared input cell can therefore change the selected condition; use an explicit input-validity rule if a missing threshold should stop the report.

These controls do not establish every blank, error-containing or imported-text combination. They also do not replace a native check for an external-workbook or client-specific workflow. Keep criteria ranges aligned, inspect actual stored types, and use a nonempty explicit criterion for the reproducible examples above.

Important edge cases and a common mistake

Watch out: Ranges with mismatched dimensions are invalid or lead to mistakes; use identical row starts and ends.

If this formula needs to work in older Excel releases, consult the Microsoft version markers first; the function’s presence in a Microsoft 365 workbook does not establish Excel 2013 support.

Troubleshooting in Microsoft Excel

Microsoft documents Formulas → Evaluate Formula for Excel for Windows. If that command is unavailable in your client, put the component expressions in separate helper cells and compare their results; also check whether numeric-looking source values are stored as text. #NAME? suggests a misspelling or an unavailable new function. #VALUE! often indicates a wrong argument type; #SPILL! on array functions often means output cells are occupied.

If you get the wrong answer but no error, try these checks in order: (1) evaluate the simplified first example; (2) confirm the cell values and data types; (3) check the exact row and column boundaries; (4) verify quoted text, comparison operators and separators; (5) only then add more criteria or nested functions.

For a reproducible comparison with another spreadsheet product, use the same input values in both applications and record the installed version and locale. Different default matching behavior or handling of empty values can be a migration issue rather than a mathematical disagreement.

Moving this formula between spreadsheet programs

Excel generally uses commas in English-language help formulas; LibreOffice and Collabora Calc commonly use semicolons. An identically named function may still have different matching defaults, dynamic-array behavior or version support.

Related guides already published for this function: LibreOffice Calc | Apache OpenOffice Calc | Gnumeric | PlanMaker 2026 | ONLYOFFICE Spreadsheet Editor

If a comparison tool says Not researched here, that means we do not yet have a checked guide for that software. It does not mean the software lacks this function. See the 12-program comparison tool for a guide-coverage matrix.

Official reference and editorial verification

Evidence level: Vendor-published function catalogue / formula overview, checked for this editorial batch on October 11, 2026; example outputs verified by direct reasoning/arithmetic where applicable. No execution in Microsoft Excel was performed. Some platform-, language- and release-specific edge cases remain for native testing.

October 14, 2026 review scope

The full guide and original examples were reviewed against the direct Microsoft COUNTIFS reference. Added results are independent arithmetic or narrowly documented type, shape and matching controls. Native Excel execution, exhaustive coercion and external-workbook behavior remain unperformed.