+ Reply to Thread
Results 1 to 7 of 7

How to rum conditional formating for several words using "text that contains" ?

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    How to rum conditional formating for several words using "text that contains" ?

    Hi Guys,
    I am familiar with "conditional formatting" for single words using "text that contains".
    But what if I have multiple words I want to check for, is there an easier way to do it, or do I have to put each one in separately?
    Doing that one by one takes too much time...
    Thanks
    Sami

  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
    52,944

    Re: How to rum conditional formating for several words using "text that contains" ?

    Could you give 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 Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    Re: How to rum conditional formating for several words using "text that contains" ?

    Sure,
    For example, lets say that I have a single column and many rows.
    Each row has only text in it.
    Something like this:

    Can you get lice from buying a flat iron from Goodwill?
    Could you help me get rid of lice PLEASE?
    can one purchase crab lice?
    friends help: how can you get body lice?
    OMG! LICE! help.. are there any natural products?
    Where could you go to get head lice out and how much would it cost?
    Head Lice--Can You Help Your Child Avoid It?
    Are there any home remedies for head lice on furniture carpet etc?
    Are there any lice free treatments without a comb?
    Are there any remedies for head lice?
    Are there lice eggs in Dr. Pepper?
    Are there signs of lice if so what are they <3?
    Can one nit cause lice?
    Can you shower right after you have a de-lice treatment?
    Can you use lice treatment to get rid of fleas?
    Could you get head lice from fleas?
    Could you get lice from a racoon that has been dead for several days?
    How can one person only get one lice bug?
    How far can a lice bug jump to its next host?
    How far can lice jump?
    How far can lice jump from human to human?
    How far do lice and fleas jump?
    How many different species of lice are there?


    I would like (using conditional formatting) to highlight only the rows that has ANY of the following 3 words: lice, far, can
    I would like to somehow do this for all 3 words (lice, far, can) at once.

    Any ideas?

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to rum conditional formating for several words using "text that contains" ?

    Hello sami770,

    Please try the attached sample Workbook.


    Regards
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

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

    Re: How to rum conditional formating for several words using "text that contains" ?

    hi Sami. what if the sentence contains something like:
    call the police

    if that is not supposed to be higlighted & you're very sure there are no such cases, select the range you want to apply to (say from A1:A10)
    go to Home -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    =SUMPRODUCT(--(COUNTIF(A1,"*"&$D$1:$D$3&"*")))

    D1:D3 is assumed to contain the 3 words

    if there are, you might have to provide the possible symbols you would have (like ?, !, & - i see in your file) to do a formula. if it's too many, you may have to resort to VBA (something i might not be able to help).

    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

  6. #6
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    Re: How to rum conditional formating for several words using "text that contains" ?

    Thank you for your help!


    Quote Originally Posted by Winon View Post
    Hello sami770,

    Please try the attached sample Workbook.


    Regards

  7. #7
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    Re: How to rum conditional formating for several words using "text that contains" ?

    That's EXACTLY what I need, thanks a lot!

    Quote Originally Posted by benishiryo View Post
    select the range you want to apply to (say from A1:A10)
    go to Home -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    =SUMPRODUCT(--(COUNTIF(A1,"*"&$D$1:$D$3&"*")))

    D1:D3 is assumed to contain the 3 words

+ 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. Code for data formating using "text to column"
    By a.hussain in forum Excel General
    Replies: 4
    Last Post: 05-30-2012, 09:57 AM
  2. Remove "TRUE" "FALSE" words from a linked checkbox
    By MDCK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2008, 03:26 AM
  3. Conditional formating-format the cell background "Red".
    By Unplugged in forum Excel General
    Replies: 9
    Last Post: 07-25-2006, 01:16 PM
  4. [SOLVED] Conditional formating on text starts with "tot"
    By Mr. Smith in forum Excel General
    Replies: 2
    Last Post: 09-14-2005, 09:05 AM
  5. Cell color: "Conditional Formating"
    By Rafael in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2005, 01:05 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