Please help with Countif, greater than, less than

sbost

New Member
Joined
Jul 1, 2002
Messages
3
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."

How should I go about programming this???? Please help!! Thanks. SB
 

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.

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
The COUNTIF function can only do one operation. So either greater than 0 or less than 3, but not both.

Try SUMPRODUCT instead:

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

Brian from Maui

MrExcel MVP
Joined
Feb 16, 2002
Messages
8,458
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."

How should I go about programming this???? Please help!! Thanks. SB

Using Countif,

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

Forum statistics

Threads
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?

Disable AdBlock

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
Top