How to Count Cells between Two Numbers

The difference between COUNTIFS and COUNTIF is that the COUNTIF function counts cells that meet a single criterion, while the COUNTIFS function can count cells with one or multiple criteria.

Example: You are working with a dataset with the first name in column A, the last name in column B, and the salary in column C.

Formula 1: To count how many people with a salary of more than $70,000 and less than $85,000.

=COUNTIFS(C2:C9,">$70,000", C2:C9,"<$85,000")

There are five people with an income between $70,000 and $85,000.

Formula 2: To count how many people with a salary between $70,000 and the average.

=COUNTIFS(C2:C12,">70000",C2:C12,"<"&AVERAGE(C2:C12))

The average of column C (C2:C12) is $76,308.82, and there are two people having an income between $70,000 and the average.

Notes: The COUNTIFS Function

Formula:

= COUNTIFS(Range 1, Criteria 1, Range 2, Criteria 2…)

Explanations:

– Range 1 is required, which is the first data range you need to count;
– Criteria 1 is required, which can be a number, a text string, an expression, or a cell reference;
– Range 2: is optional, which is the second data range that you need to count;
– Criteria 2: is optional, which can be a number, a text string, an expression, or a cell reference.
– You can add other range/criteria pairs but the maximum number of range/criteria pairs is 127.

Cautions:

Each range must have the same number of rows and columns as the first range criteria, otherwise, you will get the wrong result "#VALUE!".

Practice: COUNTIFS function

Leave a Reply