+ Reply to Thread
Results 1 to 5 of 5

Searching a cell for multiple words

Hybrid View

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    Washington, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Searching a cell for multiple words

    I am having trouble writing an efficient formula to search a cell for 3 different words (held in individual separate cells) and return the word that was found (only 0 or 1 or the 3 words would be present).

    I have tried a nesting a number of IF() statements together but a null result on any of the SEARCH() commands yields a VALUE error and the formula fails. I played around with IFERROR() and rearranging my nested IF() statements; I think I could get that to work but it would be very long and unwieldy.

    Any thoughts on the most efficient way to do this in a single cell?

    Thanks for the suggestions!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Searching a cell for multiple words

    Hi and welcome to the forum

    Perhaps if you supplied a few samples of what you are working with?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Searching a cell for multiple words

    welcome to the forum, squigman. it's always good to upload a sample excel file to show us (like FDibbins suggested). here's some guidelines:
    http://www.excelforum.com/tips-and-t...d-answers.html

    assuming your 3 words are in E1:E3 & the string you want to search in is in A1, my guess would be:
    =LOOKUP(2^15,SEARCH($E$1:$E$3,A1),$E$1:$E$3)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Searching a cell for multiple words

    Pl see the attached file.
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Searching a cell for multiple words

    Hi,

    "(only 0 or 1 or the 3 words would be present)."

    In your attached, it appears that there are cases where 2, or even 3 of the search words are present.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

+ 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. Searching for multiple words in a cell
    By CU2011 in forum Excel General
    Replies: 12
    Last Post: 05-05-2011, 11:48 AM
  2. [SOLVED] Searching a cell with multiple words
    By nervous_pilchard in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-21-2010, 10:17 AM
  3. searching a string of text for multiple words
    By easty in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-10-2009, 04:20 AM
  4. Need Help with Searching for Two Words
    By Dominator in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2005, 03:56 PM
  5. Need help Searching for Two Words
    By Dominator in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-16-2005, 02:13 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