#### sbost

##### New Member
Seems like an easy request. I have a column of numbers of varying values. I want to count all of the values that are greater than or equal to 0 but less than 3; then, in a new cell, all of the values that are greater than or equal to 3 but less than 6; and so on.

At the bottom of the column, I put in COUNTIF(b2:b52,">=0,<3"), and the result?? Zero. Even though I can count numerous 0s, 1s, and 2s just by looking. Or else it tells me I've entered "too many arguments for this function."

### Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

#### Richard Schollar

##### MrExcel MVP
Hi

Check out Sumproduct:

Code:
``=SUMPRODUCT((\$B\$2:\$B\$52>=0)+0,(\$B\$2:\$B\$52<0)+0)``

and so on.

#### Von Pookie

##### MrExcel MVP
The COUNTIF function can only do one operation. So either greater than 0 or less than 3, but not both.

=SUMPRODUCT(--(B2:B52<>"")*(B2:B52>=0)*(B2:B52<3))

#### Erdinç E. Karaçam

##### Board Regular
Hi,

Use Sumproduct if you need multiple criterias for Countif.

Code:
``=SUMPRODUCT((B1:B52>=0)*(B1:B52<=3))``

#### Brian from Maui

##### MrExcel MVP
Seems like an easy request. I have a column of numbers of varying values. I want to count all of the values that are greater than or equal to 0 but less than 3; then, in a new cell, all of the values that are greater than or equal to 3 but less than 6; and so on.

At the bottom of the column, I put in COUNTIF(b2:b52,">=0,<3"), and the result?? Zero. Even though I can count numerous 0s, 1s, and 2s just by looking. Or else it tells me I've entered "too many arguments for this function."

Using Countif,

=COUNTIF(B2:B52>=0)-COUNTIF(B2:B52 > 3)

Replies
9
Views
472
Replies
3
Views
316
Replies
3
Views
1K
Replies
4
Views
391
Replies
0
Views
87

1,136,420
Messages
5,675,737
Members
419,585
Latest member
popsin

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Which adblocker are you using?

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back