Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default COUNTIF or something else?

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.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,533
Default COUNTIF or something else?

Hi

This should do it:

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

Regards,
Per

"Count-Adi" skrev i meddelelsen
...
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.


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 27
Default COUNTIF or something else?

{=IF(A2:A12=1,COUNTIF(B2:C11,"Yes"),0)}

This should work

Atif

"Count-Adi" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default COUNTIF or something else?

Try this...

=SUMPRODUCT(--(C2:C15=1),--((D2:D15="yes")+(E2:E15="yes")=2))

--
Biff
Microsoft Excel MVP


"Count-Adi" wrote in message
...
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.



  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5
Default COUNTIF or something else?

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

"Atif" wrote:

{=IF(A2:A12=1,COUNTIF(B2:C11,"Yes"),0)}

This should work

Atif

"Count-Adi" wrote:

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.



  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5
Default COUNTIF or something else?

Great!

Thanks,

Adi

"Per Jessen" wrote:

Hi

This should do it:

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

Regards,
Per

"Count-Adi" skrev i meddelelsen
...
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.


.

  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5
Default COUNTIF or something else?

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

"Per Jessen" wrote:

Hi

This should do it:

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

Regards,
Per

"Count-Adi" skrev i meddelelsen
...
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.


.

  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5
Default COUNTIF or something else?

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

Thanks

"T. Valko" wrote:

Try this...

=SUMPRODUCT(--(C2:C15=1),--((D2:D15="yes")+(E2:E15="yes")=2))

--
Biff
Microsoft Excel MVP


"Count-Adi" wrote in message
...
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.



.

  #9   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default COUNTIF or something else?

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?

--
Biff
Microsoft Excel MVP


"Count-Adi" wrote in message
...
Sorry, It doesn't work. Anything else...(in case that I have more then 2
columns...)

Thanks

"T. Valko" wrote:

Try this...

=SUMPRODUCT(--(C2:C15=1),--((D2:D15="yes")+(E2:E15="yes")=2))

--
Biff
Microsoft Excel MVP


"Count-Adi" wrote in message
...
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.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CountIF rexmann Excel Discussion (Misc queries) 9 September 10th 09 08:52 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"