Counting Blank Cells

  • Thread starter Thread starter JimS
  • Start date Start date
J

JimS

H16 I16 J16
$25.2 $33.8

The following formula counts the number of dollar values in H, I and
J.

=IF(H16="","",IF(M16>0,COUNT(H16:J16))) [answer =2]

Without putting $0.00 in cell J16 how would I write a formula to
count all three cells? [answer = 3]
 
It depends on the requirement.

Will J16 ever contain an actual value of 0? Are the values always positive?
Do you want to count J16 even if H and I are empty?
=IF(H16="","",IF(M16>0,COUNT(H16:J16)))

You don't have a value_if_false argument defined for when M16 is not greater
than 0.

As a starting point:

=IF(H16="","",IF(M16>0,COUNT(H16:J16)+(J16=0),""))

--
Biff
Microsoft Excel MVP


JimS said:
H16 I16 J16
$25.2 $33.8

The following formula counts the number of dollar values in H, I and
J.

=IF(H16="","",IF(M16>0,COUNT(H16:J16))) [answer =2]

Without putting $0.00 in cell J16 how would I write a formula to
count all three cells? [answer = 3]
 
Hi,

Try

=IF(H1="","",IF(M1>0,COUNT(H1:J1)+COUNTBLANK(H1:J1)))

This works, thanks.
=IF(H16="","",IF(M16>0,COUNT(H16:J16)+(J16=0),""))

This also works, but the difference is that it doesn't return "false"
when M<0. I assume it's the ),"")) at the end that does that.

Thanks, to you both.
 
=IF(H16="","",IF(M16>0,COUNT(H16:J16)+(J16=0),""))
This also works, but the difference is that it doesn't return "false"
when M<0. I assume it's the ),"")) at the end that does that.

Yes, that is correct. I noted that in my original reply.
 
Hi,

Yes, but I wasn't sure exactly what you wanted - you can add "" to get rid
of False or remove the "" and level that one empty ,, and you will get FALSE.
Whatever you want.
 
Back
Top