Bug 52417

Summary: COUNTIF() wraps all regular expressions with ^ and $
Product: LibreOffice Reporter: Mike <freedesktop>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: gerard.fargeot
Priority: medium    
Version: 3.5.3 release   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Test file

Description Mike 2012-07-23 23:04:09 UTC
Created attachment 64571 [details]
Test file

Following the example from http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Regular_Expressions_in_Calc#Regular_expressions_in_Calc_functions I am getting a different result. Entering:

=COUNTIF(cell , "text")

actually becomes:

=COUNTIF(cell , "^text$")

So if a cell contains "123textABC" doing =COUNTIF(cell , "text") will not find a match, however it should. I have attached a test file which produces an error with a few cells.
Comment 1 GerardF 2012-07-24 21:11:20 UTC
Read again the link in your post :
"Additionally if "Search criteria = and <> must apply to whole cells" is ***not*** selected then 'Fred', 'bride', and 'Ridge' will also be counted. "

Please learn how to use a spreadsheet and if something goes wrong ask on user mailing list or forums before submit a bug report.