View Single Post
  #12   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

Epinn wrote...
....
=COUNTIF(rng,"#N/A*")-COUNTIF(rng,"#N/A?*") <<


I understand the first part of the formula which is used to count text. I don't have a clue
about the second part. Why the question mark? Please explain. How do I
return/generate #N/A constants. Quite lost here.


Text strings like "#N/Afoobar" are possible if highly unlikely. The
first COUNTIF call above would include such strings in its count. The
second COUNTIF call counts all text strings beginning with "#N/A" and
followed by at least one character. If you want to count only the text
"#N/A", then then you need to use the formula above first to count all
text strings beginning with #N/A then subtract any that have additional
characters.

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

....
As I stated in my previous (second) post under this thread, SUMPRODUCT doesn't work
with #N/A.


With the error value #N/A, no, but my formula was for counting TEXT
"#N/A". If you have a range that contains both the error value #N/A and
the text string "#N/A", then SUMPRODUCT doesn't work.

=SUMPRODUCT(--(B1:B6=#N/A)) returns #N/A


Agreed.

=SUMPRODUCT(--(B1:B6="#N/A")) returns #N/A <<


Only if there's an #N/A error value in B1:B6.