Although common, COUNTIFS has a unique design that splits logical conditions into two parts.

The article below has many working examples.

The syntax depends on the number of conditions being evaluated.

COUNTIFS function example with multiple conditions

Each condition is provided as a pair ofrange/criteriaarguments:

If there are two conditions, there will be tworange/criteriapairs.

If there are three conditions, there will be threerange/criteriapairs, and so on.

COUNTIFS can handle up to 127 separaterange/criteriapairs.

COUNTIFS function example with multiple conditions

Using COUNTIFS, we can count orders in the data that meet multiple conditions.

Column H shows the criteria used inside COUNTIFS and column I contains the resulting count.

Each condition requires a separate range/criteria pair, and there are three pairs in total.

COUNTIFS function example with multiple conditions

Each condition requires a separaterangeandcriteria, and operators need to be enclosed in double quotes ("").

This makes it easy to change criteria later without editing the original formula.

Notice the greater than operator (>), which is text, must be enclosed in quotes.

COUNTIFS function example with multiple conditions

Note that the second formula will count cells that containany value.

The easiest way to use COUNTIFS with dates is to refer to a valid date in another cell.

The formula above willnotcount a 3-digit number like 123 or 812.

COUNTIFS function example with multiple conditions

The worksheet below shows how wildcards can be used with the COUNTIFS function.

to match a question mark (?)

that occurs at the end of “Montana?”

COUNTIFS function example - criteria in another cell

and “Michigan?”.

The tilde (~) is an escape character that allows you to find aliteralwildcard.

To match a question mark (?

COUNTIFS function example - count cells not equal to

), use “~?

For more details,see this example.

Summary Table

you’ve got the option to use COUNTIFS to create a simple summary table.

COUNTIFS function example - count blank and not blank cells

In the worksheet below, we have a list of unique colors in F5:F9.

The goal is to subtotal the amounts in column D by color.

For more advanced users, this is an important limitation in how COUNTIFS works and what it can do.

COUNTIFS function example - working with dates

One of the more tricky limitations of COUNTIFS is that it won’t allow anarrayfor arangeargument.

This formula works fine, but it’s a little complicated.

This would be cool if it worked.

COUNTIFS function example - working with wildcards

However, Excel won’t even let you enter this formula.

However, COUNTIFS is not programmed to handle arrays, so it won’t work.

How can we work around this problem?

COUNTIFS function example - making a simple summary table

However, the latest version of Excel offers powerful alternatives, includingBYROW,BYCOL, andGROUPBY.

Numbers include negative numbers, percentages, dates, times, fractions, and formulas that return numbers.

COUNTA does not count empty cells.

COUNTIFS function example - array problem worksheet

COUNTIFS function example - array problem formula can’t be entered

Excel formula: Count items in list

Excel formula: Count calls at specific times

Excel formula: Count numbers by range

Excel formula: Count times in a specific range

Excel formula: Rank if formula

Excel formula: Count cells that contain text

Excel formula: Count cells not equal to

Excel formula: Count cells between two numbers

Excel formula: New customers per month

Excel formula: Flag first duplicate in a list

Excel formula: Subtotal invoices by age

Excel formula: Count cells that are not blank

Excel formula: Customer is new

Excel formula: Count cells less than

Excel formula: Summary count by month with COUNTIFS

Article image

Article image

Excel COUNTIF function

Excel COUNTIFS function

Excel COUNT function

Excel COUNTA function

COUNTIFS function example with multiple conditions

COUNTIFS function example - criteria in another cell

COUNTIFS function example - count cells not equal to

COUNTIFS function example - count blank and not blank cells

COUNTIFS function example - working with dates

COUNTIFS function example - working with wildcards

COUNTIFS function example - making a simple summary table

COUNTIFS function example - array problem worksheet

COUNTIFS function example - array problem formula can’t be entered