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


At 14:05 07/02/2013 -0800, Joel Madero wrote:
I have enabled regular expressions in LibreOffice settings but still am unable to get this one to work. Here is my line:
IF(N200="*regression*",1,0)

Not sure what I'm missing.

What you are missing, I think, is defining your problem! You have fallen into the error that is not at all uncommon amongst enquirers. You have shown us a formula which you tell us does not work. You have not told us what you were hoping it would do for you, leaving us to guess from the formula itself. But the one thing we can be absolutely sure of - we have your assurance for this - is that this formula does not define what you are trying to do, since it does not succeed.

In any case, I don't know what regular expression you think you have supplied here: the asterisk is used to match zero or more of the character preceding it. There is no character before your first asterisk; as regards the second, are you expecting a match for *regressio, along with *regression, *regressionn, *regressionnn, and so on?

The IF() function is a bit of a red herring. The essence of your formula is the logical expression N200="*regression*". This has a logical result (which, incidentally, is identical to the result of your IF). But there is no facility to invoke regular expressions in the logical "=" operator: it will give the answer TRUE (or 1) if and only if the two operands are equal. So you should get TRUE or 1 if N200 is exactly "*regression*" and FALSE or 0 otherwise.

There are a number of functions which allow regular expressions (see the help text), but "=" is not one of them.

I trust this helps.

Brian Barker


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


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.