+ Reply to Thread
Results 1 to 4 of 4

How do you highlight text in a column based on adjacent values?

  1. #1
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    How do you highlight text in a column based on adjacent values?

    Let's say you have one column with names and the column next to hit either has an "a" or "b" next to it. How would you highlight all the names with an "a" in the cell next to them?

    I tried conditional formatting and could see how to create a new rule to do it if there was a number in original column, but how do you do it with names?

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

    Re: How do you highlight text in a column based on adjacent values?

    Try this...

    I've used A1:B200 as the range, but choose what your range reflects.

    Names in column A and "a" or "b" in column B

    Conditional Formatting
    • Highlight applicable range >> A1:B200
    • 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: =AND(LEN($A1)>0,$B1="a")
    • Format… [Number, Font, Border, Fill]
    • OK >> OK
    HTH
    Regards, Jeff

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,727

    Re: How do you highlight text in a column based on adjacent values?

    First you should select all the cells in column A that you want this to apply, so that you only need to set it up once - assume this range is from A2 to A100.

    Then you can click on Conditional Formatting | New Rule | Use a formula... , then put this formula in the dialogue box that pops up:

    =AND(A2<>"",$B2="a")

    Click on the Format button | Fill tab and choose your colour, then OK your way out. Excel will automatically adjust the cell references to suit all the cells that had been selected.

    Hope this helps.

    Pete

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,727

    Re: How do you highlight text in a column based on adjacent values?

    Thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Pete

+ 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: 1
    Last Post: 07-29-2015, 02:30 AM
  2. Replies: 11
    Last Post: 04-30-2015, 05:35 PM
  3. Replies: 4
    Last Post: 07-25-2014, 05:17 AM
  4. Replies: 2
    Last Post: 04-17-2014, 03:30 PM
  5. Replies: 1
    Last Post: 03-02-2013, 05:06 AM
  6. Replies: 23
    Last Post: 09-25-2009, 07:39 PM
  7. Replies: 1
    Last Post: 09-19-2009, 08:09 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