ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Function countif with conditions (https://www.excelbanter.com/excel-discussion-misc-queries/46290-function-countif-conditions.html)

Gordon

Function countif with conditions
 
I have a list of numbers (2000 lines). I need to count the numbers of
the values in different ranges. eg <= $10.00, $10.01 to $100.00,
$100.01 to $500.00, etc.

The formula =COUNTIF(H2:H2001,"<=10") works. It gives me 257.

But for the next range, formula
=COUNTIF(H2:H2001,AND("10","<=100")) doesn't work.

What's the problem? How can I get this to work?


TIA


aka excel

Try the formula =COUNTIF(H2:H2001,"=10")-COUNTIF(B2:B5,"100")


"Gordon" wrote:

I have a list of numbers (2000 lines). I need to count the numbers of
the values in different ranges. eg <= $10.00, $10.01 to $100.00,
$100.01 to $500.00, etc.

The formula =COUNTIF(H2:H2001,"<=10") works. It gives me 257.

But for the next range, formula
=COUNTIF(H2:H2001,AND("10","<=100")) doesn't work.

What's the problem? How can I get this to work?


TIA



David Billigmeier

=SUMPRODUCT((H2:H200110)*(H2:H2001<=100))

--
Regards,
Dave
<!--


"Gordon" wrote:

I have a list of numbers (2000 lines). I need to count the numbers of
the values in different ranges. eg <= $10.00, $10.01 to $100.00,
$100.01 to $500.00, etc.

The formula =COUNTIF(H2:H2001,"<=10") works. It gives me 257.

But for the next range, formula
=COUNTIF(H2:H2001,AND("10","<=100")) doesn't work.

What's the problem? How can I get this to work?


TIA



kk

Hi Gordon,

You can try...

=SUMPRODUCT(--(H2:H200110),--(H2:H2001<=100))




"Gordon" wrote in message
oups.com...
I have a list of numbers (2000 lines). I need to count the numbers of
the values in different ranges. eg <= $10.00, $10.01 to $100.00,
$100.01 to $500.00, etc.

The formula =COUNTIF(H2:H2001,"<=10") works. It gives me 257.

But for the next range, formula
=COUNTIF(H2:H2001,AND("10","<=100")) doesn't work.

What's the problem? How can I get this to work?


TIA




All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com