+ Reply to Thread
Results 1 to 13 of 13

Conditional formatting: Highlight cells in a column that contain 1 or more words

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Conditional formatting: Highlight cells in a column that contain 1 or more words

    Conditional formatting: Highlight cells in a column that contain 1 or more of a set of words.

    Below: I want all cells in colum B that contain the words "CAT", "MONKEY", or "BULL" highlighted regardless of other punctuation or words in the cell.

    I found the following formula but it does not work:
    =IF(ISERROR(IF(LEN(B1)>0, FIND(","&LOWER(B1)&",", ",cat,monkey,bull,"),#VALUE!)),"=",B1)


    Please see attached spreadsheet.

    A B
    1 CAT TIGER
    2 MAN
    3 CHICKEN, DONKEY854
    4 DUCK" SNAKE
    5 MAN
    6 SNAKE, MONKEY 2658
    7 MONKEY: TIGER
    8 MAN(
    9 DOG, BIRD 4564
    10 BIRD, SNAKE
    11 TIGER, DONKEY
    12 MAN
    13 LION, MONKEY
    14 BULL, LION
    15 DONKEY, TIGER
    16 MAN
    17 COW, SNAKE..4
    18 PIG, COW
    19 MAN
    20 OWL, MONKEY

    Notice some words are not separated by spaces or are followed by or preceeded by punctuation (if the word is in complete I want the cell to be highlighted regardless of what is before or after).

    I am using Excel 2003, and was told the above formula should be entered in the cell vale/equal to....

    Thank you,
    Daniel
    Last edited by CEM; 05-05-2012 at 01:26 PM. Reason: more info

  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,939

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    try the following in yout CF...

    =NOT(AND(ISERROR(FIND($I$4,D9,1)),ISERROR(FIND($I$5,D9,1)),ISERROR(FIND($I$6,D9,1))))

    to give you more flexibility, i put CAT, MONKEY and BULL in seperate cells - I4, I5 and I6. you can replace them in the formula if you want
    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 Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    What about this in conditional formatting with your list in some cells somewhere named List

    =SUMPRODUCT(--(ISNUMBER(SEARCH(List,A4))))>0

    and the cells to be highlighted starting in A4
    Last edited by jeffreybrown; 05-05-2012 at 02:31 PM.
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    Nothing is highlighted when I enter your formula. If i remove the NOT from the begining of your formula it highlights all the cells. Shouldn't there be and "OR" somwhere in the formula?Thank you for your time...

  5. #5
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    Jeff-
    If i enter the formula nothing is highlighted. If I select cell value is/NOT equal to, it highlights all the cells....thank you for your time.

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    Does this sample help with both suggestions?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    Jeff

    Below is a section of the document I am working with. I am trying to highlight the entire cells (column E) containing the words I have highlighted in red. My previous example might be over complicating it.

    EXCEL FORUM EXAMPLE.xls

    I have a list of about 20 text terms and 333,000 lines of data I would like to aplly a conditional format to.

    Thank you

  8. #8
    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,939

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    the reason for the NOT was because i had to use error trapping if the criteria wasnt found, but if it didnt find any, it would return true...hence NOT(true).

    I checked my CF formula again, against your data on Sheet1, it does work. you had neglected to adjust the references to your actual data...see the attached
    Attached Files Attached Files
    Last edited by FDibbins; 05-05-2012 at 03:12 PM.

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    I hope this helps. The "List" is in column N.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    Jeff,

    That is exactly what I am looking for. Please forgive me...
    -How do I add terms to highlight? I entered words below your list in colum N and there was no additional highlights. How does the formula know to reference colum N for terms?
    -Are you highlighting column E and then selecting coditional format and entering your formula?
    Thank you.

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    Open up the Name Manager (Ctrl + F3)

    You will see a Name called List >> Select this name and in the box at the bottom

    Refers to: >> enter >> =Sheet2!$N$1:INDEX(Sheet2!$N:$N,MATCH(REPT("z",255),Sheet2!$N:$N))

    Now the list will expand and contract as you add/delete names in column N

    Once the conditional formatting is set you DO NOT have to update it everytime you add/delete something form column N.
    Last edited by jeffreybrown; 05-05-2012 at 03:38 PM.

  12. #12
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    Thank you for your time Jeff. Everything is working great!

  13. #13
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional formatting: Highlight cells in a column that contain 1 or more words

    You are very welcome and glad it worked out for you

    Please don't forget to mark the thread as solved if the solution(s) answer your query.

+ 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