View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default How can I use €ścountif€ť to count BOTH zeros AND blank cells as zer

Part of the problem is blank cells can be due to being *truly* empty, or they
can be "" (such as the result of some formula)

=IF(some_condition, "Condition True", "")

If the cells are truly empty, you could try
=SUMPRODUCT(--(A1:A9=0))
which treats empty cells as 0. But you will get an incorrect result if your
"empty" cells actually have an empty string, "".

I usually use the solution you've already found.



"Danielle" wrote:

How can I use €ścountif€ť to count BOTH zeros AND blank cells as zeros?
Wondering if I am unaware of a formula that exists that is less messy than my
formula below to achieve this answer.

I was going to do this: =COUNTBLANK([range]) + COUNTIF([range], 0)

D.