Bug 76343

Summary: EDITING: Single quotes instead of double quotes for raw text in function wizard
Product: LibreOffice Reporter: Tom Dougherty <dougherty.thomas.m>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: CLOSED NOTABUG    
Severity: minor CC: ilmari.lauhakangas, raal, stgohi-lobugs
Priority: medium    
Version: 4.2.0.4 release   
Hardware: x86-64 (AMD64)   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=50732
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 105582    

Description Tom Dougherty 2014-03-19 04:25:03 UTC
When inserting the COUNTIF function via the function wizard, raw text is surrounded by single quotes, rather than double quotes. This leads to a value of 0, when the value should be some other number.
Comment 1 A (Andy) 2014-03-22 10:29:44 UTC
Could you please give me more information about what you mean with "raw text is surrounded by single quotes".
Comment 2 Tom Dougherty 2014-03-23 00:26:12 UTC
For numbers, the COUNTIF function should be in the format of =COUNTIF(range,criteria). For expressions and character strings, it should be in the format of =COUNTIF(range,"criteria"). When inserting via the function wizard, it is formatted as =COUNTIF(range,'criteria'). So for instance, if in cells A1-A3, we have Alice, Bob, and Carol, respectively, and we want to find how many times Alice occurs, we'd use =COUNTIF(A1:A3,"Alice"), which would return 1.

If you at any point don't surround a literal text string criteria in the COUNTIF function with double quotes (for instance, if we had just used =COUNTIF(A1:A3,Alice) above), the text string is surrounded by single quotes (so =COUNTIF(A1:A3,'Alice'), which produces the incorrect results. Not sure why it would ever be using single quotes, as numbers don't need to be surrounded by anything, and character strings and expressions need to always be surrounded by double quotes. This seems to also be a problem in documentation; while the help file tells you that you need the double quotes, the function wizard itself does not.
Comment 3 raal 2014-09-10 18:16:43 UTC
I can reproduce with Version: 4.3.2.0.0+
Build ID: a5fedcf7fe56a56475dea484a78971c504e52272
TinderBox: Win-x86@42, Branch:libreoffice-4-3, Time: 2014-08-29_10:16:48

Quotes totally lost with Version: 4.3.2.0.0+
Build ID: 5c1b508b172f0047d86e1acde92239ebf3438251
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-3, Time: 2014-08-27_06:11:49

The same problem in functions COUNTIFS, SUMIFS, DCOUNT etc. Probably in all function wizard's search criteria.
Comment 4 QA Administrators 2015-10-14 19:57:44 UTC Comment hidden (obsolete)
Comment 5 Buovjaga 2016-01-30 13:56:31 UTC
Yeah, not seeing ANY quotes.

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: 9784ff3d878eaa21491fbd779e57d7d4710f5449
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-01-30_01:31:57
Locale: fi-FI (fi_FI)
Comment 6 Eike Rathke 2017-07-12 19:46:15 UTC
It happens only if "Automatically find column and row labels" is switched on under Tools -> Options -> Calc -> Calculate, and cell content Alice happens to be at a cell position that can be taken as a label. But that's the same when entering the formula and not related to the Function Wizard. As that Auto-Label thing can be very confusing and doing more harm than benefit the default is switched off in newer installations.

If switched off the content Alice just stays as entered in the formula, unquoted.