Issue 105036

Summary: search() function yields #value! if search fails
Product: Calc Reporter: oopla <oopla>
Component: codeAssignee: spreadsheet <spreadsheet>
Status: CLOSED DUPLICATE QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P3 CC: issues, rb.henschel
Version: OOO310m19Keywords: oooqa
Target Milestone: ---   
Hardware: PC   
OS: Linux, all   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---

Description oopla 2009-09-13 09:48:11 UTC
using the eg in guide [IT RICERCA = SEARCH]:

  RICERCA(54; 998877665544)

yields 10; but then

  RICERCA(54; 998877665584)

yields #VALORE! [ie #VALUE!) which is clearly wrong; the return value should be
eg 0 or -1, not an argument error. This breaks functions like

  IF(SEACH(123;456);"found";"x")

which neads to be rewritten in a clumsy form like eg

  IF(VAL.ERROR(SEACH(123;456));"x";"found")

which anyway prevents direct use of the SEARCH return value in eg a formula.
Comment 1 Regina Henschel 2009-09-13 16:42:30 UTC
Same problem with function FIND. But it cannot be solved easily, because the
behavior is defined in the standard ODF 1.2.

The problem is already tracked in issue 66590.

*** This issue has been marked as a duplicate of 66590 ***
Comment 2 Regina Henschel 2009-09-13 16:42:58 UTC
closing duplicate