+ Reply to Thread
Results 1 to 5 of 5

if cell contains a word from array

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    bratislava
    MS-Off Ver
    Excel 2010
    Posts
    3

    if cell contains a word from array

    hello,

    i was trying to find a formula that returns 1 or 0 (or true / false), if cell A1 contains any word from array B1 to B20.

    i found a function =OR(NOT(ISERR(SEARCH(B1;A1)));NOT(ISERR(SEARCH(B2;A1)));NOT(ISERR(SEARCH(B3;A1))))
    but it only works for B1 - B8, than the formula is too long.

    i also made a function that finds out if A1 is exactly the same as B1, B2, B3,... but that it is not what i need, i need to find out if the string in A1 contains any of the words

    can you pls help me?

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

    Re: if cell contains a word from array

    hi Pali, welcome to the forum. something like this?
    =IF(SUMPRODUCT(--(ISNUMBER(SEARCH(B1:B20,A1)))),1,0)

    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

  3. #3
    Registered User
    Join Date
    10-24-2012
    Location
    bratislava
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: if cell contains a word from array

    thanks, that's just what i needed

  4. #4
    Registered User
    Join Date
    10-02-2012
    Location
    Baku
    MS-Off Ver
    Excel 2010
    Posts
    273

    Re: if cell contains a word from array

    An array formula
    =SUM(--(B1:B20=A1))

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: if cell contains a word from array

    @ Pali

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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