Needing a little help in understanding the logic I am trying to use IF and COUNT IF

Copper Contributor

Hi all.   I have two separate worksheets, one of which needs to be connected to another.  On  Sheet 1 for column K, I have either "true" or "false".  In Sheet 2 for cell B6, I want to count all the number of "true"s from Sheet 1.  No "false" cells will be counted.  

 

I am sure my logical thinking is off here.   =if('Sheet 1'!K2:K29="true", "Sheet 2"=countif(B6)).   How close did I get to what I wanted to do?  If the formula is wrong, what formula should I have been using?  Thanks very much for your help on this.

3 Replies

Hi Scott,

 

Please try this formula: 

=COUNTIF(Sheet1!K:K,TRUE)

 

 

Thanks for you suggestion. I tried it and the answer came up 0, which I thought was odd.

Hi Scott,

 

I guess that the TRUEs and FALSEs are parsed as texts, and it seems that the COUNTIF function cannot handle this situation!

 

So please replace the previous formula with this:

=SUMPRODUCT(--(K:K="TRUE"))

Hope that helps