View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default TRUE - Boolean vs. Text

Bob Phillips wrote...
....
Not that it doesn't look right, it shouldn't work because #N/A is not text.
I think it only works because of poor coding, it wasn't designed to do so (a
personal view)


The 2nd argument to COUNTIF/SUMIF *was* meant to be a criteria
expression. Whether that was meant to encompass error values is a
mystery Microsoft is unlikely to resolve, but it would have taken extra
work to ensure that something like "<#N/A" was treated as not equal to
the #N/A error value, and that argues for intent.

No, you are wrong there, it counts true #N/As, either a simple =NA() or as a
result of another more complex conditional function.


You're forgetting #N/A constants, but to pick the text "#N/A" it's
necessary to use

=COUNTIF(rng,"#N/A*")-COUNTIF(rng,"#N/A?*")

but

=SUMPRODUCT(--(rng="#N/A"))

would be best.