• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to modify formula in cell T2?

Eloise T

Active Member
● Cell T2 needs to ignore the cells with $0 and read "11" for the number of cells WITH a number greater than zero.

Cell T2
=IF(COUNTA(C2.P2)<>0,COUNTA(C2.P2),"-")

Please see attached Excel file.
 

Attachments

I shall use the CountIF function to count the values greater than zero..

=COUNTIF(C2.P2,">0")
 
This works: =IF(COUNTIF(C2.P2,">0"),COUNTIF(C2.P2,">0"),"-")

Thanks.

This works, too: =IF(SUM(C2.P2)>0,COUNTIF(C2.P2,">0"),"-")
 
Last edited:
Why not simply: =COUNTIF(C2 : P2,">0")
and apply a custom number format of
0;-0;"-"
 
I inserted a space between the : and the P in the Range
so that you get =COUNTIF(C2 : P2,">0")
not: =COUNTIF(C2:P2,">0")
 
This works: =IF(COUNTIF(C2: P2,">0"),COUNTIF(C2: P2,">0"),"-")

Thanks.
Hi,

Your logical test and TRUE result are same, so you don't really need the IF here.
Go with just COUNTIF as mentioned above with a custom format.

Here is one more alternate:
Code:
=SUMPRODUCT(SIGN(C2:P2))

Regards,
 
Back
Top