View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default 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")