+ Reply to Thread
Results 1 to 3 of 3

SEARCH function, help needed!

Hybrid View

  1. #1
    Registered User
    Join Date
    07-31-2007
    Posts
    4

    Unhappy SEARCH function, help needed!

    Hello,

    I am trying to use the SEARCH function for string searching. I know that the search function will return a value if it finds the matching string, however if it does not find the matching string, it returns:

    #VALUE

    Can that be changed to 0, or something else I can work with?

    For example, if I have in Cell A1: Hello World
    And in Cell A2 I have the formula: Search("hello",A1,1)
    The search function will return the value "1" (the first instance it comes across "hello" in cell a1).

    However, if I put in cell a2: Search("bye",a1,1)
    The function will return #VALUE - and I can't work with that! It would be great if it returned "0" - indicating it didnt' find it.

    Any ideas?? Maybe I'm using the wrong function ?? Thanks!!

    Ali

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    =IF(ISERROR(SEARCH("hello",A1,1)),"no Hello",SEARCH("hello",A1,1))

  3. #3
    Registered User
    Join Date
    07-31-2007
    Posts
    4
    that's perfect! thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1