View Single Post
  #3   Report Post  
serhat serhat is offline
Junior Member
 
Posts: 2
Default

Quote:
Originally Posted by joeu2004[_2_] View Post
"serhat" wrote:[i]
I have two values something like those;
0,0424063491580365
0,0424063491580364
If I subtract them I got zero but f I count
them with Countif function in a list I got these
two walues as different


I don't believe you get exactly zero. If they are in A1 and A2, calculate
=A1-A2 in A3, then compare =A3=0. It should return FALSE.

(Note: There is a reason why I avoid =A1-A2=0. Long story.)

I suspect you think their difference is zero only because of formatting.
When A3 is formatted as General, I get 1.04083E-16, a very small number.

Anyway, if you want to treat them as equal, you should use ROUND. But you
cannot use ROUND directly with COUNTIF. You could write:

=SUMPRODUCT(--(ROUND(A1:A10000,14)=A1))

But there are some subtle differences between that and COUNTIF, especially
when A1:A10000 contains numeric text.

Note: It is "bad practice" to write COUNTIF(A:A,A1), even though you can.
It is not too bad using Excel 2003 and earlier. But with Excel 2007 and
later, Excel must do 1+ million comparisons. It is unlikely you ever have
that many rows. Instead of A:A, choose a reason range like A1:A10000 or
even A1:A100000.
dear joeu thakns for your reply.
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

how should I do in order to gget rid of this conflict?
By the way I cannot round them because in my list I have lots of values (exatly 122880 values) and there are many different decimal numbers and by making round some different values may become equal