Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I count cells that are between two numbers in Excel?

I need a formula to count the number of cells in a range that are between 10 and 10.000:

I have:

=COUNTIF(B2:B292,>10 AND <10.000) 

But how do I put the comparison operators in without getting a formula error?

like image 249
czioutas Avatar asked May 02 '13 18:05

czioutas


People also ask

How do I count between two numbers in Excel?

Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers. For example, you can enter the following formula to count the numbers in the range A1:A20: =COUNT(A1:A20). In this example, if five of the cells in the range contain numbers, the result is 5.

Can you use Countif for a range of numbers?

To count numbers or dates that fall within a range (such as greater than 9000 and at the same time less than 22500), you can use the COUNTIFS function.

Can you Countif 2 conditions?

You can use the COUNTIFS function in Excel to count cells in a single range with a single condition as well as in multiple ranges with multiple conditions. If the latter, only those cells that meet all of the specified conditions are counted.


2 Answers

If you have Excel 2007 or later use COUNTIFS with an "S" on the end, i.e.

=COUNTIFS(B2:B292,">10",B2:B292,"<10000")

You may need to change commas , to semi-colons ;

In earlier versions of excel use SUMPRODUCT like this

=SUMPRODUCT((B2:B292>10)*(B2:B292<10000))

Note: if you want to include exactly 10 change > to >= - similarly with 10000, change < to <=

like image 172
barry houdini Avatar answered Oct 11 '22 10:10

barry houdini


Example-

For cells containing the values between 21-31, the formula is:

=COUNTIF(M$7:M$83,">21")-COUNTIF(M$7:M$83,">31")
like image 35
user3713594 Avatar answered Oct 11 '22 10:10

user3713594