Re: [sc-dev] String Operations in Calc and Advanced Utilities

2006-10-31 Thread Niklas Nebel

Leonard Mada wrote:
Exactly this is the problem. It returns an *ERROR*, so searching for 
string 1 OR string 2 will fail grandiosely. Actually, it is 
impossible to perform this search in calc. This is a *BUG*. (the full 
comments can be found for issue 66590)


It's possible using ISERROR. One day, for compatibility, we'll need an 
IFERROR-like function, which will also make such cases easier to handle.


Niklas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sc-dev] String Operations in Calc and Advanced Utilities

2006-10-31 Thread Eike Rathke
Hi Leonard,

On Tuesday, 2006-10-31 19:57:17 +0200, Leonard Mada wrote:

 It's possible using ISERROR. One day, for compatibility, we'll need an 
 IFERROR-like function, which will also make such cases easier to handle.
 
 Easier to handle sounds a little bit cynical. Here are the 2 search 
 possibilities:
 
 *method 1*
 // DOES NOT WORK IN CALC OR EXEL
 FIND(string 1, A1) OR FIND(string 2, A1)
 
 *method 2*
 using ISERR(): take a small break, a cup of coffee and enjoy:
 [this actually works in Exel]
 - we will need 7 additional columns (B-H) in addition to the data 
 column (A)
 - B: =FIND(string 1, A1)
 - C: =FIND(string 2, A1)
 - D: = ... here will be our final result
 - E: =ISERR(B1)
 - F: =ISERR(C1)
 - G: =IF(E1=FALSE,B1,0)
 - H: =IF(F1=FALSE,C1,0)
 - and now lets return to column D, where the final result will be stored:
 - D: = OR(G1, H1)

I'd shorten that to

B: =IF( ISERROR( FIND( string 1; A1)); FIND( string 2; A1); FIND( string 
1; A1))

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to this [EMAIL PROTECTED] account, which I use 
for
 mailing lists only and don't read from outside Sun. Thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]