ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   CountIf (https://www.excelbanter.com/excel-discussion-misc-queries/143527-countif.html)

Eze

CountIf
 
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

JE McGimpsey

CountIf
 
One way:

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

another:

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

In article ,
Eze wrote:

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


Eze

CountIf
 
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


"JE McGimpsey" wrote:

One way:

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

another:

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

In article ,
Eze wrote:

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




All times are GMT +1. The time now is 04:38 AM.

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