Date: prev next · Thread: first prev next last
2021 Archives by date, by thread · List index

Regular expressions are a shorthand way of specifying strings against
which to match an input. In the COUNTIF(), MATCH(), VLOOKUP(), etc.
functions, when you provide a regular expression, you are asking to
compare your input to a summary version of what you are looking for.
For example, the expression "[hH]ello" means that you are looking for
the word "hello" that could begin with either an uppercase or lowercase
letter. The way to write the shorthand depends on the application you
are using. Though many applications support regular expressions, some
support all, a subset, or extensions to the basic regular expression
syntax. The document you found seems to be a good description of what
LO supports.

Now, for your question in particular. The COUNTIF() function wants, as
part of its syntax, that comparing the input to your match string
produces a TRUE/FALSE result, like in the IF() function. This is
different from MATCH() or VLOOKUP() where the objective is to obtain a
full or partial match. To allow you to make this happen, COUNTIF()
requires the use of comparison operators (=, <, <=, >, >=, <>) when a
test is made with a non-boolean (TRUE/FALSE) value. Those operators are
not part of the expression: they are there to tell COUNTIF() how to
compare the input with your expected value. If you place the function
=COUNTIF(A1:A1,"<>[Hh]ello") in cell B1, would be exactly the same as
putting =IF(AND(A1<>"Hello",A1<>"hello"),1,0) in B1. In this case, the
expression is [Hh]ello, and the comparison operator is <>.

I hope this helps.

Le vendredi 09 juillet 2021 à 11:39 +0100, Dave Howorth a écrit :
On Thu, 8 Jul 2021 22:38:49 +0100
David Lynch <> wrote:

The documentation 

for COUNTIF gives the following examples, among others:

  and these do indeed work.

  However the list of regular expressions linked from the COUNTIF

does not include the use of > and < as operators.

Neither does the "full list of supported metacharacters and syntax"
linked from the help page in the previous paragraph.

Neither does the page
<> linked from the
REGEX help page

Please, is there anywhere that tells me what regular expressions

David Lynch

Version: (x64) / LibreOffice Community
Build ID: a529a4fab45b75fefc5b6226684193eb000654f6
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render:
VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded

I don't believe that '>'and '<' used as operators are regular
expressions. They are parts of more general 'criteria', which the

implies are 'wild cards'. But searching the documentation doesn't
any definition or even explanation of what a wild card is :(

So I think the answer to your question is that the definition of
regexes supported is indeed
<> but
that the particular criterion you are interested in is not a regex
thus not documented there. Perhaps somebody else knows where such
criteria ARE documented?

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
Privacy Policy:


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.