+ Reply to Thread
Results 1 to 4 of 4

search for multiple text strings within an IF statment

  1. #1
    Registered User
    Join Date
    09-12-2008
    Location
    Oregon
    Posts
    9

    search for multiple text strings within an IF statment

    Hi, I am having a problem finding multiple text values in an "if" statement.
    what I want to do is check for four different text strings in a cell for the logical test.
    For example if the cell contains 'MDF','PB','PART', OR 'PLAT', I want to return "MACHINE1" otherwise return "MACHINE2".
    I can't seem to get the FIND ISNUMBER and OR statements to work together.
    Anyone have any ideas for me?
    Thanks a bunch,

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(SUM(COUNTIF(A1,{"*MDF*","*PB*","*PART*"}))>0,"Machine1","Machine2")
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    09-12-2008
    Location
    Oregon
    Posts
    9

    Thanks

    That did it! Thanks a lot for the quick reply!

  4. #4
    Registered User
    Join Date
    01-05-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: search for multiple text strings within an IF statment

    Thanks! This works perfectly!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. search and select rows on user entered text
    By FoeNyne in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-05-2014, 02:56 PM
  2. extracting text strings from a cell
    By penfold in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-27-2008, 06:41 AM
  3. Keyword Search on Strings of Text
    By odie82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-25-2007, 08:00 PM
  4. Extracting strings of text from Columns of data(text)
    By welshmagic69 in forum Excel General
    Replies: 9
    Last Post: 04-23-2007, 02:50 PM

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