View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default countif function

PS.... I wrote:
"serhat" wrote:
Please try these two actual values below which are in my list.
20,7286008849557
20,7286008849558
say A1 and A2
whilst A1-A2=0; countif(A1:A2;A1)=1

[....]
You need to accept the fact that the values are truly different (as I
explain below).


I just realized that I was misled by your subject line, "countif function".

Presumably, your issue is not (or should not be) with COUNTIF. After all,
your example numbers are visibly different. So of course COUNTIF(A1:A2;A1)
should return 1.

Instead, your issue is (or should be) with A1-A2 returning exactly zero,
despite the visible difference.

I did explain all that in previous posting. And I alluded to the remedy.
But just to re-iterate and emphasize....

If you want to avoid that dubious heuristic described in KB 78113, you can
do several things.

Change formulas of the form =A1-A2 to =(A1-A2) or =A1-A2-0.

Surprisingly, even just adding parentheses defeats that heuristic. It is as
if parentheses are an operator; so the "last operation" is not subtraction
from the point of view of the heuristic.

Likewise, comparisons of the form IF(A1=A2,...) should be changed to
IF(A1-A2=0,...).