Counting Blank Cells

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]
 
T

T. Valko

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]
 
J

JimS

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.
 
T

T. Valko

=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.
 
S

Shane Devenshire

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top