ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Count within a range (https://www.excelbanter.com/excel-programming/343872-count-within-range.html)

Darin Kramer

Count within a range
 

Hi Guys

Column 1 is a number between -1 and 30

I need to know the:
Number of occurences between -1 and 5
Number of occurences between 6 and 10
Number of occurences between 11 and 15
Number of occurences between 16 and 30

Any ideas... count if..?




*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_6_]

Count within a range
 
=SUMPRODUCT(--(A1:A100=-1),--(A1:A100<-5))

etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Darin Kramer" wrote in message
...

Hi Guys

Column 1 is a number between -1 and 30

I need to know the:
Number of occurences between -1 and 5
Number of occurences between 6 and 10
Number of occurences between 11 and 15
Number of occurences between 16 and 30

Any ideas... count if..?




*** Sent via Developersdex http://www.developersdex.com ***




Tom Ogilvy

Count within a range
 
for a countif solution

=count(A:A)-Countif(A:A,"5")
=countif(A:A,"5")-Countif(A:A,"10")
=Countif(A:A,"10")-Countif(A:A,"15")
=Countif(A:A,"15")

--
Regards,
Tom Ogilvy


"Darin Kramer" wrote in message
...

Hi Guys

Column 1 is a number between -1 and 30

I need to know the:
Number of occurences between -1 and 5
Number of occurences between 6 and 10
Number of occurences between 11 and 15
Number of occurences between 16 and 30

Any ideas... count if..?




*** Sent via Developersdex http://www.developersdex.com ***




Darin Kramer

Count within a range
 

Perfect - THanks RP, If I wanted to add a further complication... Say
column 2 was either A, B or C so I Want all the occurences of type A
which are more than -1 and greater than 5 etc... possible...?


Regards

DK

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_6_]

Count within a range
 
Yes it is

=SUMPRODUCT((A1:A100=-1)*(A1:A100<=5)*(B1:B100={"A","B","C"}))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Darin Kramer" wrote in message
...

Perfect - THanks RP, If I wanted to add a further complication... Say
column 2 was either A, B or C so I Want all the occurences of type A
which are more than -1 and greater than 5 etc... possible...?


Regards

DK

*** Sent via Developersdex http://www.developersdex.com ***




Tom Ogilvy

Count within a range
 
For just type A as asked it would be:

=SUMPRODUCT((A1:A100=-1)*(A1:A100<=5)*(B1:B100="A"))

or

=SUMPRODUCT((A1:A100=-1),(A1:A100<=5),--(B1:B100="A"))

--
Regards,
Tom Ogilvy


"Bob Phillips" wrote in message
...
Yes it is

=SUMPRODUCT((A1:A100=-1)*(A1:A100<=5)*(B1:B100={"A","B","C"}))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Darin Kramer" wrote in message
...

Perfect - THanks RP, If I wanted to add a further complication... Say
column 2 was either A, B or C so I Want all the occurences of type A
which are more than -1 and greater than 5 etc... possible...?


Regards

DK

*** Sent via Developersdex http://www.developersdex.com ***






Darin Kramer

Count within a range
 


Thanks! :)

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 01:11 PM.

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