+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting Conundrum

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Conditional Formatting Conundrum

    I’ve been struggling to get Conditional Formatting to accommodate this:


    If C2 , D2 and E2 all contain the letter "O" then the font for all should be green.

    If any of them are changed to "P" then the font for those cells still containing "O" should now become red.

    For those now containing “P” the font should become blue.

    I’d be grateful for any assistance with this. I can get so far with it but can’t find the way for it to be completely working.

    Last edited by CDandVinyl; 11-04-2020 at 10:53 PM.
    Using Excel , Word and Access 2003 - For the whole of 2024

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional Formatting Conundrum

    Conditional formatting is not as powerful in 2003 as it is in 2007 forward. I implemented it in a modern version and got a warning when I back-converted it but I think it will work. However, I cannot show you how to re-create it from scratch in 2003 because the rules will look different. And I haven't used 2003 for over 10 years. There are probably a handful of people who do Excel consulting professionally that keep around an old version for questions like this.

    Conditional formatting doesn't know anything about the order you do things, so it cannot understand "changed from P to O". The logic I used was state analysis:

    If all cells are O then they are all green
    If at least one cell is P, and all of the ones that are not P are O, then the P cells will be blue and the O cells will be red. (This requires two separate rules.)
    If there is any other combination, then there is no color for any of the cells.

    These rules don't care about what order you do things. If you start with three O cells (all green), change one of them to P (P becomes blue, two O cells become red), then delete an O cell, they will all lose their color. In a situation like that, if you want the P cell to stay blue as long it contains a P, no matter what else happens, then you need VBA.
    Attached Files Attached Files

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Conditional Formatting Conundrum

    First, set defaul color is "red"
    Conditional formatting formula:
    =C2="P"
    set as "blue"
    =COUNTIF($C2:$E2,"O")=3
    set as "green"
    Attached Images Attached Images
    Attached Files Attached Files
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Conditional Formatting Conundrum

    Hi Guys

    Ok thanks. As it sometimes happens , these things end up being more complicated than they first appear!

    I can see that it does work in 2003 in the examples you gave so I'm really grateful for these working solutions.

    Last edited by CDandVinyl; 11-04-2020 at 11:08 PM.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting Conundrum

    Green =COUNTIF($C$2:$E$2,"O")=3
    Blue =(SEARCH("P",$C2&$D2&$E2)+2)=COLUMN(C2)
    Red =(SEARCH("P",$C2&$D2&$E2)+2)<>COLUMN(C2)
    Ben Van Johnson

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional Formatting Conundrum

    Glad I was able to help, thanks for the rep!

+ 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. [SOLVED] Textbox formatting conundrum
    By Tresfjording in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-11-2020, 02:40 PM
  2. [SOLVED] Override conditional formatting (in general, without changing the conditional formatting)
    By Stormin' in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2017, 07:15 AM
  3. [SOLVED] Conditional Formatting Conundrum
    By kyjae in forum Excel General
    Replies: 3
    Last Post: 03-26-2015, 11:54 AM
  4. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  5. Conditional Formatting Conundrum
    By kwelch66 in forum Excel General
    Replies: 2
    Last Post: 01-18-2014, 02:17 PM
  6. conditional formatting conundrum
    By henro8 in forum Excel General
    Replies: 6
    Last Post: 08-05-2008, 11:08 AM
  7. Formatting conundrum
    By scunni in forum Excel General
    Replies: 3
    Last Post: 10-29-2006, 08:12 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