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]

Reply via email to