+ Reply to Thread
Results 1 to 7 of 7

Conditional Formating for EXACT word or phrase

  1. #1
    Registered User
    Join Date
    09-24-2007
    Posts
    60

    Conditional Formating for EXACT word or phrase

    I found the following post:

    "In your questions, please include only the information directly related to one specific question. In this case, I'll assume your actual question is: in a particular range, how do I shade only those cells that contain the word "apple" or "pear" etc?

    In range A1:A5, enter:

    apple
    pear
    orange
    berry
    grape

    How can you shade all cells in col C that contain one of these words?

    In D1, enter:

    =SUM(IF(ISERROR((FIND($A$1:$A$5,C1))),0,1))

    as an array (after entering formula in cell, instead of hitting Enter, hit Ctrl-Shift-Enter). Then copy the D1 formula down col D.

    Select col C. From main menu, choose Format, Conditional Formatting, formula is, =(D1>0), format, patterns, [red], OK, OK.

    All col C cells that contain one of the key words will now have red pattern. "

    The above works great but if I want to look for the phrase "the apple" it fails, or if I want to look for the exact match of "apple" it fails. For example I can type snapple and it will give column D a 1. Any idea how to make it an exact match or match on a phrase?

    Thanks
    Last edited by elfvis; 11-17-2011 at 03:30 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Formating for EXACT word or phrase

    The changing D1 formula to:

    =SUM(IF(ISERROR((FIND(" "&$A$1:$A$5&" "," "&C1&" "))),0,1))

    CSE confirmed and copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Conditional Formating for EXACT word or phrase

    Try =SUM(IF($A$1:$A$5=C1,1,0)), confirmed with Ctrl+Shift+Enter and copied down.
    Life is about perseverance. Remember: today's mighty oak tree is just yesterday's nut that held its ground.

    If you like a post, please rate it with the scales icon (top right).
    If you feel really indebted, please consider a donation to charity, such as Feed the Children or Habitat for Humanity.

  4. #4
    Registered User
    Join Date
    09-24-2007
    Posts
    60

    Re: Conditional Formating for EXACT word or phrase

    Quote Originally Posted by NBVC View Post
    The changing D1 formula to:

    =SUM(IF(ISERROR((FIND(" "&$A$1:$A$5&" "," "&C1&" "))),0,1))

    CSE confirmed and copied down.
    Solved

    Thank you very much

    PS how do I mark thread as solved?
    Last edited by elfvis; 11-17-2011 at 02:47 PM.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional Formating for EXACT word or phrase

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

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

    Re: Conditional Formating for EXACT word or phrase

    If you want to use this for conditional formatting then you don't really need to use a helper column, just select column C and use this formula in conditional formatting

    =COUNT(FIND(" "&$A$1:$A$5&" "," "&C1&" "))

    format as required
    Audere est facere

  7. #7
    Registered User
    Join Date
    09-24-2007
    Posts
    60

    Re: Conditional Formating for EXACT word or phrase

    Quote Originally Posted by daddylonglegs View Post
    If you want to use this for conditional formatting then you don't really need to use a helper column, just select column C and use this formula in conditional formatting

    =COUNT(FIND(" "&$A$1:$A$5&" "," "&C1&" "))

    format as required
    Even better

    I changed it so that I can have a sheet to act as a terms library so we can track the things a little fancier.

+ 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