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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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))
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,012
Members
449,060
Latest member
LinusJE

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
Back
Top