+ Reply to Thread
Results 1 to 18 of 18

Highlight multiple cells based on cell value

  1. #1
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Question Highlight multiple cells based on cell value

    Hello all.

    I need some help again.

    I need all cells in column A4 to A200 with multiple names (bob, steve, sue, Karen, etc) to highlight yellow with anything not listed to remain as default.

    I know this is not the formula but something like:
    =if(a2:A200="bob, steve, sue, Karen),turn name/cell yellow

    Thanks for any help

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Highlight multiple cells based on cell value

    Hello
    If you mean there are single names in each cell in A2:A200, then something like the following Conditional Formatting formula should work:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Applied to A2:A200, 'Names' being the range with your criteria.

    DBY

  3. #3
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38
    Quote Originally Posted by DBY View Post
    Hello
    If you mean there are single names in each cell in A2:A200, then something like the following Conditional Formatting formula should work:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Applied to A2:A200, 'Names' being the range with your criteria.

    DBY
    Wont that just count the names?

  4. #4
    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,946

    Re: Highlight multiple cells based on cell value

    multiple names (bob, steve, sue, Karen, etc) to highlight yellow
    Do you mean you want to count want to shade all cells with any of those names, or just cells that contain more that 1 instance of "bob" (for instance?

    If you just want to highlight every time "bob" (or any name) gets repeated, look at using Conditional Formatting (what DBY suggested)...

    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select "only unique or duplicate values"
    4. "duplicate" should be already selected - if not, pick that
    5. Format Fill with your desired color

    (btw, the COUNTIF() formula that DBY suggetsed, would have gone into CF as a "use formula" rule)
    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

  5. #5
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Re: Highlight multiple cells based on cell value

    I don't need anything to be counted or if anything is repeated. I just want to be able to add a formula that will highlight the names I specify in the formula.

    Each name will only be listed once but could be in a different place.

    Say you have the full alphabet from A - Z but I want to highlight in yellow only the letters D,H,R,M X.

  6. #6
    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,946

    Re: Highlight multiple cells based on cell value

    Sorr, that was a typo, it meant to ask...
    Quote Originally Posted by FDibbins View Post
    Do you mean you want to shade all cells with any of those names, or just cells that contain more that 1 instance of "bob" (for instance?)

  7. #7
    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,946

    Re: Highlight multiple cells based on cell value

    1 way of doing this would be to have a list of names you want to highlight (I used J1:J3), then...

    (having a problem posting, so posting a bit at a time)

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

    Re: Highlight multiple cells based on cell value

    1 way of doing this would be to have a list of names you want to highlight (I used J1:J3), then...

    (having a problem posting, so posting a bit at a time)

  9. #9
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Re: Highlight multiple cells based on cell value

    Quote Originally Posted by FDibbins View Post
    Sorr, that was a typo, it meant to ask...
    Just to shade the cells with the names that would be specified and anything within that specified name list would stay as is.

    Thanks very much

  10. #10
    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,946

    Re: Highlight multiple cells based on cell value

    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula

  11. #11
    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,946

    Re: Highlight multiple cells based on cell value

    4. enter =COUNTIF($H$1:$H$8,$J$1:$J$3) format fill as needed

  12. #12
    Registered User
    Join Date
    12-15-2012
    Location
    In a bin
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Highlight multiple cells based on cell value

    Hi

    Like the attached!

  13. #13
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Re: Highlight multiple cells based on cell value

    Quote Originally Posted by FDibbins View Post
    4. enter =COUNTIF($H$1:$H$8,$J$1:$J$3) format fill as needed
    Im sorry, I dont understand: Wont the COUNTIF just count something and I don't know what the H and J bits have to do with it & where would I put the list of names I want it to highlight?

  14. #14
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Re: Highlight multiple cells based on cell value

    Quote Originally Posted by Crisp Packet View Post
    Hi

    Like the attached!
    Not 100% what I was looking for but I think I could make that work.

    Will the NAMES look for the exact match in the NAME LIST or a partial match (starting with, containing etc)?



    I have got this to do what i want it to do.


    Thanks very much everyone

    Last edited by mrbret; 12-10-2015 at 02:58 PM. Reason: Problemm solved

  15. #15
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Highlight multiple cells based on cell value

    Hello
    There's obviously some confusion here, my CF formula would highlight a cell if for example that cell contained only the value 'Bob' or 'Steve' or 'Karen' etc. Conditional formatting relies on True of False statements to work. If COUNTIF is 0 then False, not zero True, so if say cell A2 = 'Bob' and Bob is in the names list then it returns a count greater than zero which equals True and the cell changes format, in this case yellow fill. However, if the cells contain not a single word but a string, ie: 'Bob, Karen, Steve', then my formula wouldn't work and would need to be amended.

    DBY

  16. #16
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Re: Highlight multiple cells based on cell value

    One more question related to the above info.

    Is there a way to delete the cells instead of highlighting in yellow?

    Thanks again

  17. #17
    Registered User
    Join Date
    12-15-2012
    Location
    In a bin
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Highlight multiple cells based on cell value

    Hi mrbret

    Probably code to delete the cells.
    But in my sample file, change the conditional formatting from yellow fill to no fill and change the font colour to white.

  18. #18
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38
    Quote Originally Posted by Crisp Packet View Post
    Hi mrbret

    Probably code to delete the cells.
    But in my sample file, change the conditional formatting from yellow fill to no fill and change the font colour to white.
    That does work but if that info is copy/pasted into an email those blanked out cells can be copied and those names can be seen. Im trying to stop that

+ 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. Formula to highlight cells based on multiple criteria and sheets.
    By cascencio83 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-16-2015, 10:18 PM
  2. [SOLVED] highlight cells based on multiple parts with different tolerances for each
    By TJ_IE in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-02-2014, 12:56 PM
  3. [SOLVED] Count cells in row based on cell value, highlight row if wrong number or cells.
    By gutterball in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-11-2014, 04:00 PM
  4. Replies: 4
    Last Post: 07-25-2014, 05:17 AM
  5. Highlight 1 cell based on value from other cells
    By freeon in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-10-2013, 01:24 PM
  6. Highlight or colour a cell or cells based on cells in another range.
    By baffld in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2012, 08:41 PM
  7. Replies: 3
    Last Post: 09-14-2009, 03:13 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