How can I count a column of numbers

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

and return the number of values that fall within certain criteria?

For example, if I have 300 salaries listed, and wanted to group them into
these ranges:
3000-5999
6000-8999
9000-11999
12000-14999

etc.

Countif (as far as I know) can only have one argument.

TIA!
 
You may want to look at =frequency() in help.
and return the number of values that fall within certain criteria?

For example, if I have 300 salaries listed, and wanted to group them into
these ranges:
3000-5999
6000-8999
9000-11999
12000-14999

etc.

Countif (as far as I know) can only have one argument.

TIA!
 
Actually, you can still use countif

=COUNTIF(A:A,">=3000")-COUNTIF(A:A,">5999")

for 3000-5999

=COUNTIF(A:A,">=6000")-COUNTIF(A:A,">8999")

and so on

you might want to replace these hard coded values with cell references and
change
the criteria there.

It can also be done using sumproduct


=SUMPRODUCT((A1:A1000>=6000)*(A1:A1000<=8999))
 
Thanks guys! Those work, and this did also:

{=SUM(IF(A2:A475<4000,1,0))}
{=SUM(IF(A2:A475>3999,IF(A2:A475<8001,1,0)))}

etc...
 
Yes, the array formula will work, but it isn't needed. In general you should use array formulas
when there is no other solution.
 
Back
Top