Bug 154058 - make FIND() return 0 instead of #VALUE error when string not found
Summary: make FIND() return 0 instead of #VALUE error when string not found
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-08 08:17 UTC by Jaroslaw
Modified: 2023-03-23 13:40 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslaw 2023-03-08 08:17:24 UTC Comment hidden (obsolete)
Comment 1 Stéphane Guillou (stragu) 2023-03-22 22:13:07 UTC Comment hidden (obsolete)
Comment 2 Jaroslaw 2023-03-23 07:36:07 UTC
(Translate by Google)

Hello

I noticed that CALC functions like:
- FIND
- FINDB (FINDB)
and similar operating on text, if they do not find a result, they return the error message #VALUE (#ARG).

The results in text strings are counted from 1 so I suggest instead of #ARG that these functions return 0 (string not found) - it would make their use much easier.

e.g. instead of writing:
IF(ISERROR(FIND(",",F1)),"",CONCATENATE(J1,F2))

would be simpler (more readable):
IF(FIND(",",F1)=0;"";CONCATENATE(J1,F2))

above the problem is quite troublesome when tables with a large amount of text are processed in CALC, because the FIND function without ISERROR is a bit weak.

Kind regards
Comment 3 Stéphane Guillou (stragu) 2023-03-23 13:40:42 UTC
Thank you for the suggestion.
I think this will not change as many users check the result of FIND() to be a number with ISNUMBER(), to return TRUE if there is a match.
If the behaviour is changed, their code would be invalidated.