View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Epinn Epinn is offline
external usenet poster
 
Posts: 605
Default TRUE - Boolean vs. Text

Yes, I agree with both of you.

As a matter of fact, ISNA is probably *the* way to capture #N/A error because COUNTIF......#N/A purely won't work and not because it doesn't look right.

=COUNTIF(B1:B6,"#N/A") ...... I know it works ...... <<<


If I am not mistaken, COUNTIF ......"#N/A" or "#N/A*" only WORKS in capturing *text* "#N/A" and not the error #N/A. Unlike COUNTIF ...... TRUE, there is no way to use COUNTIF ...... #N/A (without quotes like TRUE) to count the error. So, looks like ISNA is the way.

If anyone wants to do things the hard way, may be one can try

COUNTIF ...... ISERROR minus COUNTIF ...... ISERR to count #N/A errors.

I say this because I have finally got the difference between ISERROR and ISERR registered in my memory bank.

Have a good weekend, guys.

Epinn

"Bob Phillips" wrote in message ...
I don't like

=COUNTIF(B1:B6,"#N/A")

I know it works, but it just doesn't feel right, #N/A is not text. I much
prefer

=SUMPRODUCT(--ISNA(B1:B6))


"Epinn" wrote in message
...
Biff,

Thanks for your response.

When I said "the only way" my emphasis wasn't on COUNTIF but on "*true" and
TRUE. I was wondering if checking both was the only way. I was hoping that
I could write out "true" in some way *once* and I could catch both logical
and text. I guess not.

I didn't know that only COUNTIF requires the wildcard and SUMPRODUCT was
okay without it. Very strange.

=SUMPRODUCT(--(A1:A6="true"))+SUMPRODUCT(--(A1:A6=TRUE))

Thanks for telling me about #N/A. I have no problem using COUNTIF for #N/A
but I have a problem using SUMPRODUCT.

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

Unlike "true" or TRUE, neither one of the above two formulae for #N/A works.
Will stick with COUNTIF.

Any suggestion? No guarantee required.

Epinn

"Epinn" wrote in message
...
Biff or anyone,

Is this the only way to count both text "true" and logical TRUE?

=COUNTIF(A1:A10,"*true")+COUNTIF(A1:A10,"true")

Thanks.

Epinn