+ Reply to Thread
Results 1 to 10 of 10

conditional format for text that contains MULTIPLE words

  1. #1
    Registered User
    Join Date
    02-02-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    conditional format for text that contains MULTIPLE words

    hey, so I searched for an answer to this but couldn't find anything that would work.

    I have a column full of product names and a column full of colors words like "red' "white" "blue" etc.

    What I want to do is highlight the cell in the product name column if it contains ANY of the words in the "color" column. so if a product name contains the word "red" OR "white" OR "blue" I want it to highlight.

    I see a lot of posts saying to set the "color" column to a range with a name like "color" and then use the formula =MATCH(A1,color,0) where A1 would be the first cell in my product name list. But this won't work for me, because the product names are long and contain many other words, so searching for an exact match of the entire product name in the color column will never return a match.

    Any idea on how to do this?

    Thanks!
    Attached Files Attached Files
    Last edited by KPK185; 03-12-2013 at 11:24 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: conditional format for text that contains MULTIPLE words

    It would be useful if you'll upload a small sample workbook.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

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

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    02-02-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional format for text that contains MULTIPLE words

    attached a sample spreadsheet to the original post.

    thanks!

  4. #4
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: conditional format for text that contains MULTIPLE words

    It's a tad crude, but ...
    Attached Files Attached Files

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: conditional format for text that contains MULTIPLE words

    In Conditional formatting rules.

    =NOT(ISERROR(LOOKUP(2^15,SEARCH($B$2:$B$12,$A2),$B$2:$B$12)))

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: conditional format for text that contains MULTIPLE words

    You could use this formula applied to column A

    =COUNT(SEARCH(B$2:B$12,A1))

    but note that might match partial words, e.g. it matches "Stone" to "cobblestone". So to prevent that try

    =COUNT(SEARCH(" "&B$2:B$12&" "," "&A1&" "))
    Audere est facere

  7. #7
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: conditional format for text that contains MULTIPLE words

    Hi KPK185

    See the attached file. The Color List is a named range called "ColorList", so you can add to it if required.
    Attached Files Attached Files
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  8. #8
    Registered User
    Join Date
    02-02-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional format for text that contains MULTIPLE words

    you guys are the best.

    thanks so much!

  9. #9
    Registered User
    Join Date
    11-24-2020
    Location
    BANGKOK
    MS-Off Ver
    2013
    Posts
    1

    Re: conditional format for text that contains MULTIPLE words

    How i can download the file.

  10. #10
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: conditional format for text that contains MULTIPLE words

    You should be able to click on the file. Even though this thread was from 2013, the uploads are still there (I just checked). If you still can't, send me your email address and I'll send you a copy directly.

+ 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