Bug 77343 - FILTER: formula countif does not count text with "text (text)"
Summary: FILTER: formula countif does not count text with "text (text)"
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.2.1 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-11 20:26 UTC by Nick
Modified: 2014-04-11 20:54 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2014-04-11 20:26:44 UTC
Problem description: 

Steps to reproduce:
1. Cell A1 = "text (more text)"
2. Cell B1 = =COUNTIF(A1:A4,A1)

Current behavior:
Cell B1 = 0

Expected behavior:
Cell B1 = 1

Without the () the formula works correctly. ex:
1. Cell A1 = "text more text"
2. Cell B1 = =COUNTIF(A1:A4,A1)
Cell B1 = 1
Operating System: Windows 7
Version: 4.2.2.1 release
Comment 1 m_a_riosv 2014-04-11 20:54:26 UTC
Hi Nick, thanks for reporting.

If you disable regular expressions in:
 Menu/Tools/Options/LibreOffice calc/Calculation - regular expression,
the formula works fine.

Please take in account that COUNTIF() use regular expressions and the parenthesis are part of them, to search for a parenthesis with regular expressions activated you need to precede the parenthesis with a back slash \( or \).
(Search in the help for regular expression to learn more about it).

To solve this situation you can do:
=COUNTIF(A1:A4;SUBSTITUTE(SUBSTITUTE(A1;"(";"\(");")";"\)"))

So for me there is not a bug, please if you are not agree reopen it.