View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff Biff is offline
external usenet poster
 
Posts: 1,688
Default TRUE - Boolean vs. Text

I agree with Bob.

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

Biff

"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