Show a value if a text cell includes a specific string

Processing a bank statement. Trivial problem.

I’m trying to show a copy of the ‘In’ amount in a different column if the corresponding description contains a specific string (such as ‘Interest’). These can then give a column total of all ‘Interest’ rows.

I would expect
IF(SEARCH(“Interest”, D6, 1) > 0, F6, “”)

(for row 6 where the description is in column D and the ‘In’ payments are in column F)
to work, but on the rows where ‘Interest’ is not found, the cell shows ‘#VALUE!’.
I guess that the SEARCH function does not return a numeric value if a match isn’t found, but the documentation doesn’t say what is returned so I can’t allow for it.

How to achieve this?

Been a programmer for nearly 50 years, but of course a spreadsheet function isn’t a programming function.

David

Many thanks to Lupp and Earnest Al. ISNUMBER solves the problem.

Please consider to also read my answer to my own question here.

Does question 282269 help?

As opposed to the usage of searching functions in general programming (also the InStr() function e.g. in LibreOffice Basic) the searching Calc functions don’t return a 0 (zero) if no match was found, but an error.
You therefore need to use =IF(ISNUMBER(SEARCH("Interest"; D6)); F6;"") instead of what you tried.
Unfortunately help texts seem to not expose this clearly.

(editing a bit later)
Just for fun. And because there are doubts concerning the reliability of any pulling to rubrics based on a few keywords. I always chose the rubric for any transaction manually in my bank-account data.
ask286857pullToRubrics_1.ods
The little playground needs LibO V 6.2 or higher to work.