CountIf

E

Eze

Hi,
Does anyone knows how can I use CountIf with two criteria conditions. For
example if I want to Count numbers with the following criteria: >=40 and <45.
What shall I write in the criteria field
I tried using & or and in the criteria field but it didn't work
Thanks
 
J

JE McGimpsey

One way:

=COUNTIF(A1:A100,">=40") - COUNTIF(A1:A100,">=45")

another:

=SUMPRODUCT(--(A1:A100>=40),--(A1:A100<45))
 
E

Eze

thanks. This helped me but I thought that there was a way to write both
conditions in the same line, for example =COUNTIF(A1:A100,">=40&<45") but it
seems that there is not
 
Top