ExcelFormulas logoExcelFormulas.
Ask AI
Statistical & AnalysisVerified QA Tested

COUNTIFS.

Counts cells that meet multiple criteria.

Category: Statistical & Analysis
ExcelExcel 365Excel 2021Excel 2019Google Sheets

How it works.

COUNTIFS counts the number of cells in one or more ranges that meet a set of conditions. You can add up to 127 criteria ranges and conditions.

💡 In simple terms.

Counts how many cells in one or more ranges meet specific conditions.

Everyday Analogy

"Think of this like counting toys. It counts only the toys that match your description (like counting only red blocks, ignoring blue cars and red balls)."

Formula syntax.

Standard Excel Notation
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Tip:Arguments wrapped in square brackets [like_this] are optional; all other arguments are required.

Formula arguments.

Every parameter accepted by the COUNTIFS function is detailed below.

criteria_range1Required

The first range to apply the first condition against.

Example value: A2:A6
criteria1Required

The condition to check in criteria_range1.

Example value: "Pending"
criteria_range2Optional

The second range to evaluate.

Example value: B2:B6
criteria2Optional

The condition to check in criteria_range2.

Example value: ">100"

Simple example.

Step-by-Step Scenario

Filtered Survey Counts

Count how many high-spending customers gave a positive response.

CustomerPurchase SizeFeedback Yes/NoMin PurchaseQualified Count
John120Yes>=100—
Sarah45Yes——
Mike250No——
Applied Formula
=COUNTIFS(B2:B6, ">=100", C2:C6, "Yes")
Expected Result:Calculated output

Evaluates COUNTIFS over the sample table cells, placing the verified output in cell E2.

Formula generator.

Full Generator Wizard

Customize the argument fields below to generate a tailored COUNTIFS formula ready to paste directly into your worksheet.

Generated FormulaReady to copy

Expected result behavior.

Returns "Calculated output" based on sample evaluation criteria and active cell references.

Sample Output:Calculated output
Output Type:Text String

Best Practices

  • Use wildcards like "?" (matches single char) and "*" (matches any sequence) to count partial text matches.
  • Use COUNTIFS to count blanks using double quotes: "" or non-blanks using "<>".

Common Mistakes

  • Just like SUMIFS, all criteria ranges must be the exact same height and width, or the function fails with a #VALUE! error.
Compatibility Database

Platform & version compatibility.

Verified platform compatibility matrix based on actual spreadsheet calculation engine specifications.

Excel✓
Supported
Excel 365✓
Supported
Excel 2021✓
Supported
Excel 2019✓
Supported
Google Sheets✓
Supported
Microsoft Excel History & Version Availability

Core standard function supported across all modern and legacy Microsoft Excel versions (365, 2021, 2019, 2016, 2013, 2010), as well as Excel for the Web and Mac.

Google Sheets Compatibility Notes

100% compatible with Google Sheets. Uses identical argument order, data types, and standard calculation logic.

Frequently asked questions.

Technical Q&A
Can I use COUNTIFS across different worksheets in Excel?↓

Yes. You can reference cells located on other sheets by including the sheet name followed by an exclamation mark, for example: =COUNTIFS(Sheet2!A2:A10). If the sheet name contains spaces, enclose it in single quotes: ='Q1 Report'!A2:A10.

What is the most common reason for errors in COUNTIFS?↓

Just like SUMIFS, all criteria ranges must be the exact same height and width, or the function fails with a #VALUE! error.

Does COUNTIFS work identically in Google Sheets?↓

Yes, COUNTIFS is supported in both Microsoft Excel and Google Sheets with standard evaluation behavior.