Issue 74606 - COUNTIF(a1,"="&a1) sometimes returns 0
Summary: COUNTIF(a1,"="&a1) sometimes returns 0
Status: CLOSED DUPLICATE of issue 69749
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 2.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: ooo
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-16 15:13 UTC by jcuadros
Modified: 2013-08-07 15:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Bug example (10.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2007-02-18 07:41 UTC, jcuadros
no flags Details
Screenshot (41.08 KB, image/png)
2007-02-18 11:48 UTC, kpalagin
no flags Details
Bug test file (10.13 KB, application/vnd.oasis.opendocument.spreadsheet)
2007-02-18 22:15 UTC, jcuadros
no flags Details
Screenshot (90.67 KB, image/png)
2007-02-18 22:16 UTC, jcuadros
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description jcuadros 2007-02-16 15:13:51 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.
Comment 1 kpalagin 2007-02-17 18:59:33 UTC
jcuadros,
please attach problematic document.
Thanks.
Comment 2 jcuadros 2007-02-18 07:41:08 UTC
Created attachment 43118 [details]
Bug example
Comment 3 kpalagin 2007-02-18 11:44:01 UTC
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).
Comment 4 kpalagin 2007-02-18 11:48:26 UTC
Created attachment 43126 [details]
Screenshot
Comment 5 jcuadros 2007-02-18 22:15:01 UTC
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).
Comment 6 jcuadros 2007-02-18 22:15:51 UTC
Created attachment 43138 [details]
Bug test file
Comment 7 jcuadros 2007-02-18 22:16:45 UTC
Created attachment 43139 [details]
Screenshot
Comment 8 kpalagin 2007-02-19 05:15:53 UTC
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).
Comment 9 frank 2007-02-19 11:54:29 UTC
Hi Eike,

please have a look at this one and re-target if possible.

Frank
Comment 10 ooo 2007-02-19 14:00:59 UTC
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 ***
Comment 11 ooo 2007-02-19 14:01:23 UTC
Closing dup.