Apache OpenOffice (AOO) Bugzilla – Issue 74606
COUNTIF(a1,"="&a1) sometimes returns 0
Last modified: 2013-08-07 15:12:27 UTC
The formula COUNTIF(a1,"="&a1) returns an unexpected value of 0 (instead of 1) for some random numbers (for example, 0.1132236701559500000). This may lead to uncatchable errors when counting in ranges. The error has been duplicated in two different machines running Windows XP and with different version of OOo (2.0.4 and 2.1). The error is not reproduceable in Excel.
jcuadros, please attach problematic document. Thanks.
Created attachment 43118 [details] Bug example
jcuadros, can't reproduce on two machines (2.1 and 2.2m7 on WinXP) - see attached screenshot. Please see if you can reproduce the problem yourself on different computer (or in virtual machine environment).
Created attachment 43126 [details] Screenshot
My mistake. The issue seems to get corrected on opening the file. It might be related to the use of a random number as the value to be counted. I'm attaching another test file where the error will eventually appear (Please, press F9 (recalculate) until it does). Attached is also a screenshot of the error. The error was already checked in different computers. I don't think it affects but my locale is Spanish (Spain).
Created attachment 43138 [details] Bug test file
Created attachment 43139 [details] Screenshot
Confirming with 2.1 and 2.2m5 on WinXP - after 4th or so recalculation with F9 I get "0" in random cell. Seems to be related to http://www.openoffice.org/issues/show_bug.cgi?id=69749 (Competing spreadsheet does not exhibit this problem).
Hi Eike, please have a look at this one and re-target if possible. Frank
The old binary precision story. In this special case please note that the COUNTIF with "="&A3 converts the number to a string and then converts it back to a number to compare the value, which isn't necessarily identical. The error does not occur when changing the formula appropriate, e.g. in C3 =COUNTIF(A3;A3) *** This issue has been marked as a duplicate of 69749 ***
Closing dup.