ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   SEARCH function returning #VALUE! error (https://www.excelbanter.com/excel-discussion-misc-queries/231889-search-function-returning-value-error.html)

jhchan

SEARCH function returning #VALUE! error
 
I'm trying to use an IF statement with my SEARCH function so that if a "-" is
found I will do one thing but if it is not found it will do something else.

However, the statement bombs when there is no "-" found. It returns the
#VALUE! and it no longer evaluates my IF expression. It just stops and
returns the error value instead of giving it the value I put in the IF
statement for false.

Anyone know how to get around that?
my test statement looks like this:
=IF(SEARCH("-",B178) 0, "True", "FALSE")


David Biddulph[_2_]

SEARCH function returning #VALUE! error
 
=IF(ISNUMBER(SEARCH("-",B178)), "True", "FALSE")
or if you want a logical rather than text
=ISNUMBER(SEARCH("-",B178))
--
David Biddulph

jhchan wrote:
I'm trying to use an IF statement with my SEARCH function so that if
a "-" is found I will do one thing but if it is not found it will do
something else.

However, the statement bombs when there is no "-" found. It returns
the #VALUE! and it no longer evaluates my IF expression. It just
stops and returns the error value instead of giving it the value I
put in the IF statement for false.

Anyone know how to get around that?
my test statement looks like this:
=IF(SEARCH("-",B178) 0, "True", "FALSE")





All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com