Thread: countif results
View Single Post
  #15   Report Post  
Lookin for a job
 
Posts: n/a
Default

That sounds reasonable.

Plenty of alternatives available to avoid this but it just seemed like such
a simple and basic formula that had me baffled.

I've been using XL for years and can't ever remember running into this before.

Thanks to everyone for their input.



"JE McGimpsey" wrote:

I'm certainly not an authority, but I'll take a guess. The
implementation of COUNTIF() parses the comparison argument as a string,
so

=COUNTIF(A10:A20,"=" & B1)

will interpret the concatenated string and attempt to deduce the
argument type from the context. When a comparison operator is left out,
"=" is implied, so just as

=COUNTIF(A10:A20,10)

is syntactically equivalent to

=COUNTIF(A10:A20,"=10")

So

=COUNTIF(A10:A20,"True")

is syntactically equivalent to

=COUNTIF(A10:A20,"=True")

Obviously, the function parser will preferentially interpret arguments
as numbers or booleans rather than strings, so the boolean will be
matched.

However, when you use a wildcard:

=COUNTIF(A10:A20,"TRUE*")

it forces the parser to interpret the argument as a string, and thus
match


In article ,
"Lookin for a job" wrote:

What's the difference between -

=Countif(A10:A20,"apples")

and

=Countif(A10:A20,"True")