ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Countif with dynamic criteria (https://www.excelbanter.com/excel-worksheet-functions/8753-countif-dynamic-criteria.html)

FinChase

Countif with dynamic criteria
 
I am trying to write a countif statement where the criteria is a range of
numbers from 30 - 39. This is what I've written:

=countif(e2:e1956,"29<40")

Right now it is counting everything over 29.

JulieD

Hi

two methods
=COUNTIF(E2:E1956,""&29)-COUNTIF(E2:E1956,""&39)

or
=SUMPRODUCT(--(E2:E195629),--(E2:E1956<40))

Cheers
JulieD

"FinChase" wrote in message
...
I am trying to write a countif statement where the criteria is a range of
numbers from 30 - 39. This is what I've written:

=countif(e2:e1956,"29<40")

Right now it is counting everything over 29.




Don Guillett

try
=sumproduct((e2:e195629)*(e2:31956<40))

--
Don Guillett
SalesAid Software

"FinChase" wrote in message
...
I am trying to write a countif statement where the criteria is a range of
numbers from 30 - 39. This is what I've written:

=countif(e2:e1956,"29<40")

Right now it is counting everything over 29.




Bob Phillips

=SUMPRODUCT(--(E2:A195629),--(E2:A1956<40))

or

=COUNTIF(E2:A1956,"29")-COUNTIF(E2:A1956,"=40")

--

HTH

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


"FinChase" wrote in message
...
I am trying to write a countif statement where the criteria is a range of
numbers from 30 - 39. This is what I've written:

=countif(e2:e1956,"29<40")

Right now it is counting everything over 29.




FinChase

Thanks to everyone who replied. It all helped.

"Don Guillett" wrote:

try
=sumproduct((e2:e195629)*(e2:31956<40))

--
Don Guillett
SalesAid Software

"FinChase" wrote in message
...
I am trying to write a countif statement where the criteria is a range of
numbers from 30 - 39. This is what I've written:

=countif(e2:e1956,"29<40")

Right now it is counting everything over 29.





Don Guillett

glad to help

--
Don Guillett
SalesAid Software

"FinChase" wrote in message
...
Thanks to everyone who replied. It all helped.

"Don Guillett" wrote:

try
=sumproduct((e2:e195629)*(e2:31956<40))

--
Don Guillett
SalesAid Software

"FinChase" wrote in message
...
I am trying to write a countif statement where the criteria is a range

of
numbers from 30 - 39. This is what I've written:

=countif(e2:e1956,"29<40")

Right now it is counting everything over 29.








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

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