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


At 08:45 08/02/2013 -0800, Joel Madero wrote:
On Fri, Feb 8, 2013 at 8:06 AM, Johnny Rosenberg wrote:
2013/2/8 Brian Barker:
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.

Very funny indeed.
The rest of us, who hopefully are thinking creatures, realise that he accidently gave an example of ”wild cards” while talking about regular expressions. Since he was talking about regular expressions all the time, I think most people would assume that that is what he meant, and that the example probably was a typo or that he don't know the difference. Yet…

Anyway, … never mind, I don't have time for this.

I actually went to bed thinking "crap, that email wasn't very clear " lol. My apologies indeed, I should know better!

So I have a column N that has keywords, some of them are blank, some of them have items such as "regression" or "regression, bibisect" or "bibisect, regression" etc...

What I want to do is have a column O that has a 1 if ANY TEXT in column N is equal to "regression" so all three of the above strings would show a 1.

Clear?

For what it's worth, my "funny" reply was meant quite seriously: I wasn't being sarcastic.

Yes: quite clear this time.  Try:
=NOT(ISERROR(FIND("regression";Nn)))
(Regular expressions not involved.) This will populate your column with TRUE and FALSE; if you prefer, you can change these to 1 and 0 simply by formatting the column appropriately as Number.

I trust this helps a little more.

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.