count function

  • Thread starter Darts via OfficeKB.com
  • Start date
D

Darts via OfficeKB.com

I want to count cells going across but do not want to count that cell if it
is blank or has a 0
Example =count(e4:I4) the answer returns 5 however in cell f there is no
data so the answere should be 4. how can i write a formula so if the cell is
blank or has 0 it does not count that cell.

thanks
 
P

Pete_UK

Try this:

=COUNTIF(E4:I4,"<>") - COUNTIF(E4:I4,0)

The first term will ignore blanks and the second term will count the
zeros and subtract them.

Hope this helps.

Pete
 
D

Darts via OfficeKB.com

thanks works great!!!

now what if I have no how can i tell it not to count no but have it count yes

Pete_UK said:
Try this:

=COUNTIF(E4:I4,"<>") - COUNTIF(E4:I4,0)

The first term will ignore blanks and the second term will count the
zeros and subtract them.

Hope this helps.

Pete
I want to count cells going across but do not want to count that cell if it
is blank or has a 0
[quoted text clipped - 6 lines]
 
Top