+ Reply to Thread
Results 1 to 2 of 2

Simple IF(SEARCH() Question

Hybrid View

  1. #1
    Registered User
    Join Date
    09-24-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    2

    Simple IF(SEARCH() Question

    I would like to use the following function,

    =IF(SEARCH(" ",B2,1)>0, do something, else do something)

    This works fine unless B2 does not contain a space. If this occurs I get error #VALID!. I only want to perform the operation if B2 has content that is separated by a space.

    Seems simple. Anyone have a solution for me?

    Thank you in advance.

    Phil.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792

    Re: Simple IF(SEARCH() Question

    Hello Phil, try using ISNUMBER like this

    =IF(ISNUMBER(SEARCH(" ",B2)),"do something","do something else")
    Audere est facere

+ 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