SOLVED

# COUNTIF formula ignoring empty and zeroes

Copper Contributor

# COUNTIF formula ignoring empty and zeroes

Hi,

I am trying to self-learn, also I am not English and it is possible for my "program language" to be wrong, please excuse me.

This is the formula which I am using =COUNTIF(Main!\$E\$3:\$E\$158,Main!E3)

I would like to know (in column H) how many times my product code is repeated in column E, unfortunately when the cell is empty, it is counted too, so I have 109 empty cells in this column and this number is showing. I would like this when the cell is empty or 0, to not be counted, and column H to stay empty. I hope this makes some sense.

Thank you and kind regards

Milena

2 Replies
best response confirmed by MiM_87 (Copper Contributor)
Solution

# Re: COUNTIF formula ignoring empty and zeroes

Perhaps

=IF(Main!E3="", "", COUNTIF(Main!\$E\$3:\$E\$158, Main!E3))

# Re: COUNTIF formula ignoring empty and zeroes

Thank you very much, was very helpful :)
1 best response

Accepted Solutions
best response confirmed by MiM_87 (Copper Contributor)
Solution

# Re: COUNTIF formula ignoring empty and zeroes

Perhaps

=IF(Main!E3="", "", COUNTIF(Main!\$E\$3:\$E\$158, Main!E3))