Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Format based on adjacent cells being equal

    Is it possible to conditionally format cells when the adjacent cell is equal to it? For example, if b170 = c170, then format one or both cells with some sort of shading?

    If so, how?

    Thanks!!
    Troy

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    Troy,

    To do this select the cells you wish to highlight then select Conditional Formatting -> Use Formula:
    ConditionalFormatting.JPG
    Enter formula shown above (Use the second one as I entered it first. If you want both cells formatted select the adjacent range and then use the 1st formula shown as it was the second one I entered. I should have changed the order but I already made the screen capture and I'm sure you can adjust. Make sure you enter both = signs in the formula! HTH and Happy New Year!
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked well for the most part. Thanks!! The only downside I found is that this is not case-sensitive. For example, it shows "KM" and "Km" as identical. I still learned a lot, and appreciate the help with this!!

    I also tried a different method. In an empty column to the right, I put the following formula:

    =IF(B2=C2,TRUE)

    Then I filter the TRUEs.

    However, this does not appear to be case-sensitive either.

    Any ideas on how to make at least one of these methods case-sensitive or provide another method that is?

    Thanks!!

  4. #4
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually, I just found a solution that works for the second method using "EXACT":

    =IF(EXACT(B4242,C4242),TRUE)

    Is it possible to do that with conditional formatting? I tried but could not get that to work.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,468
    Thanks
    30
    Thanked 61 Times in 57 Posts
    Just use: =EXACT(B4242,C4242)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •