+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting using a rule "Contains"

  1. #1
    Registered User
    Join Date
    08-22-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    3

    Conditional formatting using a rule "Contains"

    Dear Conditional Formatting gurus, could someone please advise how could I do the following - I'd like to make a whole row Red, if a cell value in the Status column contians a specifice "text"

    Could you please provide an example on how I could do that?

    Thanks a lot in advance.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Conditional formatting using a rule "Contains"

    If your status column is the D column and your text you're looking for is the word "bogus", then use this formula in the conditional formatting rule:
    =SEARCH("bogus",$D2,1)>0

    Fill that format across and down as many rows/columns as needed.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

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

    Re: Conditional formatting using a rule "Contains"

    If status column is column G then you can colour all of A2:Z2 by doing this:

    Select A2:Z2,

    use this formula in conditional formatting

    =$G2="text"

    Note the $, you need that
    Audere est facere

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Conditional formatting using a rule "Contains"

    Hi Daddylonglegs - You're formula is shorter and easier to use. Maybe I misread the requirement. I thought the user was looking for testing whether any portion of the text string in the status column contained a certain word, rather than the cell value being exactly equal to the keyword. If the cell value needs to be exactly equal, then yours is the prefered method.

  5. #5
    Registered User
    Join Date
    08-22-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    3

    Thumbs up Re: Conditional formatting using a rule "Contains"

    Thanks a lot Thomas - your answer did help! I was looking for "testing whether any portion of the text string in the status column contained a certain word".
    One question though: did you put "$D2,1" as a joke to test if I figure it out? "$D2,1" identifies the previous row; since I wanted to make Red the row that conatains the "text", but D2 makes Red the previous row, I used =SEARCH("bogus",$D1,1)>0 instead and it worked just fine!

    Thanks again!

+ 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