+ Reply to Thread
Results 1 to 10 of 10

highlight certain cells based on text in different cell

  1. #1
    Registered User
    Join Date
    08-29-2012
    Location
    Pensacola, Fl
    MS-Off Ver
    Excel 2021
    Posts
    36

    highlight certain cells based on text in different cell

    So, I have a billing spreadsheet with a list of names in column E. I have pay columns that are based on years of experience. The names in Column E contain an * if they are first year and ** if they are 2nd year. What I want to do is change the background colors depending on * or **. I've tried with conditional formatting but what I've tried isn't working. So, if cell E5 has a name: last name, first name (*) then I want cell H5 to turn blue. Can conditional formatting do this alone or do I need a formula to assist? Thanks in advance.

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

    Re: highlight certain cells based on text in different cell

    If you have name name (*) (with parentheses) then yes CF alone can do this for you, and yes you will need a formula (in CF to do it for you.
    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
    Registered User
    Join Date
    08-29-2012
    Location
    Pensacola, Fl
    MS-Off Ver
    Excel 2021
    Posts
    36

    Re: highlight certain cells based on text in different cell

    Any idea what my formula would be to make this happen?
    Last edited by AliGW; 09-26-2019 at 05:43 PM. Reason: Please don’t quote unnecessarily.

  4. #4
    Registered User
    Join Date
    08-29-2012
    Location
    Pensacola, Fl
    MS-Off Ver
    Excel 2021
    Posts
    36

    Re: highlight certain cells based on text in different cell

    Ok. I think I've figured out a formula for a single cell. I'm using =ISNUMBER(SEARCH("*",E5))

    Now, I'm struggline to apply this to a group. So, cells E4-E128 contain the names. Column H (cells H4-H128 contain a number.
    I want the cells in column H to only turn blue if the cells in column E contain a (*) So, now how do I apply the conditional
    formatting to a range of cells. When I highlight the cells and enter the formula in conditional formatting and set the color,
    it doesn't work.

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

    Re: highlight certain cells based on text in different cell

    You need to apply the conditional format to the range

    Conditional Formatting
    • Highlight applicable range >> H4-H128
    • Home Tab >> Styles >> Conditional Formatting >> New Rule
    • Select a Rule Type: Use a formula to determine which cells to format
    • Edit the Rule Description: Format values where this formula is true: =ISNUMBER(SEARCH("*",E5))
    • Format… [Number, Font, Border, Fill]
    • OK >> OK

    Note: When you apply conditional formatting, you must select the first cell in the range to the end. You cannot select H128 and highlight up to the H4.
    HTH
    Regards, Jeff

  6. #6
    Registered User
    Join Date
    08-29-2012
    Location
    Pensacola, Fl
    MS-Off Ver
    Excel 2021
    Posts
    36

    Re: highlight certain cells based on text in different cell

    that's perfect. Now, Is there a way to apply it to mulitple columns, H, P, X and AF? When I highlight the cells 4-128 in those columns, it only applies the formatting to the last column selected and not the other 3.

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

    Re: highlight certain cells based on text in different cell

    Is the formula the same for all columns? Are all columns going to reference E?

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

    Re: highlight certain cells based on text in different cell

    If all those columns are going to evaluate against column E, then is the Applies to box >> =$H$4:$H$128,$P$4:$P$128,$X$4:$X$128,$AF$4:$AF$128

    Also, your formula should actually be =ISNUMBER(SEARCH("~*",$E4)) or else everything will be true.

    There is a significant difference between using the asterisk and the asterisk preceded by the ~.

    The asterisk is a wild card and in this case means anything in the cell. Instead we place the ~ in front of the asterisk which tells Excel to look for the specific asterisk character.

    ~ = Tilde
    Last edited by jeffreybrown; 09-26-2019 at 07:46 PM.

  9. #9
    Registered User
    Join Date
    08-29-2012
    Location
    Pensacola, Fl
    MS-Off Ver
    Excel 2021
    Posts
    36

    Re: highlight certain cells based on text in different cell

    Thank you very much for the help and getting me going in the right direction. I was able to get it solved entirely. Thanks again.

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

    Re: highlight certain cells based on text in different cell

    You are very welcome and thanks for the feedback!

+ 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. Replies: 6
    Last Post: 12-28-2021, 12:04 PM
  2. [SOLVED] Highlight row based on text within string in cell
    By ~TaC~ in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-19-2019, 05:48 PM
  3. Highlight cells based on text contained in another Sheet
    By hummer123 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2016, 04:57 AM
  4. How to highlight the cell based on text
    By Ankit_Kumar in forum Excel General
    Replies: 4
    Last Post: 06-11-2015, 02:25 AM
  5. Replies: 6
    Last Post: 10-23-2014, 04:48 PM
  6. [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
  7. Replies: 3
    Last Post: 08-28-2009, 11:16 AM

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