COUNTIF or something else?

C

Count-Adi

I am trying to use COUNTIF function where the range might vary. For instance,
I want to know how many yes I have in column D and E together, with the
condition that C will be only equal with 1.

C D E
1
1 Yes
1 Yes
1
2 Yes
2
2 Yes
3 Yes
3 Yes
3 Yes
3

{=COUNTIF(IF($C$1:$C$11=1,$D$1:$E$11,0),"yesâ€)} should be 2.

Thanks for your help.
 
P

Per Jessen

Hi

This should do it:

=SUMPRODUCT(--(C1:C11=1),--(D1:D11="yes"))+SUMPRODUCT(--(C1:C11=1),--(E1:E11="yes"))

Regards,
Per
 
C

Count-Adi

In this way it counts for all cells( from B2 to C11), but I am interested
only for those whit 1 in column A. Thanks
 
C

Count-Adi

Great!

Thanks,

Adi

Per Jessen said:
Hi

This should do it:

=SUMPRODUCT(--(C1:C11=1),--(D1:D11="yes"))+SUMPRODUCT(--(C1:C11=1),--(E1:E11="yes"))

Regards,
Per



.
 
C

Count-Adi

Sorry, I have another question. What about having 30 columns from where I
should count these yes values with the same condition? It will be a long
formula. Is there anything else that might be shorter?

Thanks
 
C

Count-Adi

Sorry, It doesn't work. Anything else...(in case that I have more then 2
columns...)

Thanks
 
T

T. Valko

Sorry, It doesn't work.

Hmmm...
how many yes I have in column D and E together,
with the condition that C will be only equal with 1.

......C.....D.....E
1...2......y......y
2...1.............y
3...1......y.....y
4...3..............
5...1......y......

If that's your data what result do you expect?

My interpretation of your post is:

Count how many rows where column C = 1 and *BOTH* column D and column E
contain yes. So, based on that interpretation my formula would return1,
counting only row 3.

Is that what you wanted? If not, a better explanation is needed.
(in case that I have more then 2 columns...)

Exactly how many columns?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top