I am using COUNTIF to count the various values in a column. There are 9 different values in a column of 47 rows. Two of these values contain parentheses.
The function returns 0(zero) for these values only. I suspect it is because of the parentheses. I have even tried copy & paste a cell's content into the formula with identical results. Is this a bug, or is there an escape character I should be using?
[Solved] COUNTIF() issue
[Solved] COUNTIF() issue
Last edited by stanheer on Tue Dec 04, 2018 6:43 am, edited 1 time in total.
Open Office 4.1.2 on Windows 7
Re: COUNTIF() issue
COUNTIF() allows regular expressions in the search term and parentheses are special characters in regular expressions. You can either go to the menu Tools -> Options, expand the Calc list on the left, choose Calculate and remove the selection from Enable Regular Expressions in Formulas or you can escape the parentheses with \.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: COUNTIF() issue
Thanks, I sort of expected an answer like that, but now my curiosity is piqued: Since the default is to allow Regular Expressions, what is the downside to disabling the option?
Open Office 4.1.2 on Windows 7
Re: COUNTIF() issue
I don't think there is a downside as long as you know that the option is there. You also have to know which functions support regular expression. FIND() does not and SEARCH() does, for example. There are multiple holes for the unwary to fall into but if you remember to check whether regular expressions are turned on and check the documentation of the functions, you can navigate the options fairly easily.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.