+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting to adapt font color to background color

  1. #1
    Registered User
    Join Date
    05-16-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    23

    Conditional formatting to adapt font color to background color

    I have some formulas in my worksheet that turn out NA errors. I would like to make the worksheet look clean so I don't want the errors to display.

    In the past, I used an IFERROR function to handle this and to display blank ("") in case of error. This worked totally fine until I added sparklines to the worksheet. Now I really need the NA and not blanks because blanks are handeled as zero by the sparklines. I need the sparklines to show a gap in case of error.

    I wanted to turn the font white in case of error so that the NA errors are not visible. My problem is that I have other conditional formattings in the same area that change the background color. Meaning that some of the errors would be displayed white on a blue background.

    I could start writing more formulas to the conditional formatting:

    1) if both condition 1 and 2 are true => turn font blue and background blue
    2) if condition 1 is true and condition 2 is false => turn font white
    3) if condition 2 is true and condition 1 is false => turn background blue

    This would get even more complicated if I had more conditions. I feel like there must be a better way - like if condition 1 is true, then adapt to the remaining formatting (conditinal formatting included) of the cell. I tried looking in the conditional formatting dialog boxes for something like "make invisible by mimicking the background color" but I haven't found anything.

    Any ideas?

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional formatting to adapt font color to background color

    ..I could start writing more formulas to the conditional formatting:

    1) if both condition 1 and 2 are true => turn font blue and background blue
    2) if condition 1 is true and condition 2 is false => turn font white
    3) if condition 2 is true and condition 1 is false => turn background blue
    Perhaps changing the IF statement in your formulas to IF(AND function. So in this case you'll no need more rules. Just modify the existings..
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Contributor
    Join Date
    07-30-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Conditional formatting to adapt font color to background color

    After a bit of searching, this might be what your looking for.

    http://www.mrexcel.com/forum/excel-q...ext-colot.html

  4. #4
    Registered User
    Join Date
    05-16-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Conditional formatting to adapt font color to background color

    Thank you very much. Unfortunately it seems that my level of Excel knowledge is not high enough to apply this solution to my problem. I appreciate your effort!


    Quote Originally Posted by AYData View Post
    After a bit of searching, this might be what your looking for.

    http://www.mrexcel.com/forum/excel-q...ext-colot.html

  5. #5
    Registered User
    Join Date
    05-16-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Conditional formatting to adapt font color to background color

    Quote Originally Posted by Fotis1991 View Post
    Perhaps changing the IF statement in your formulas to IF(AND function. So in this case you'll no need more rules. Just modify the existings..
    Thank you, I'm not sure if this is what you meant but it worked. However I had to add a third rule because I don't see how to do it with two:

    1) =AND(ISNA(C1);OR((WEEKDAY(C$1;2)=6);(WEEKDAY(C$1;2)=7))) => turn both font and fill blue

    2) Cell contains an error => turn font white

    3) =OR((WEEKDAY(C$1;2)=6);(WEEKDAY(C$1;2)=7)) => turn fill blue

+ 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. VBA Module counts background color, would like it to count font color
    By LawBeforeGrace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2013, 08:11 AM
  2. [SOLVED] To Row Background color on conditional formatting
    By sawatamali in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 09-18-2012, 01:37 PM
  3. [SOLVED] how can I conditionally change font color, or background color?
    By MOHA in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2006, 01:57 PM
  4. Replies: 1
    Last Post: 10-28-2005, 12:05 PM
  5. Excel 2003 Font Color and Background Color
    By DrankPA6 in forum Excel General
    Replies: 1
    Last Post: 08-12-2005, 07:05 PM

Tags for this Thread

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