+ Reply to Thread
Results 1 to 6 of 6

Use Conditional Formatting When Reference Cell Not Blank

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Emporia, KS
    MS-Off Ver
    Excel 2000
    Posts
    5

    Use Conditional Formatting When Reference Cell Not Blank

    I am using conditional formatting to change the fill color of a cell if the value does not equal a reference cell. The problem I am having is that the reference cell will be blank after data is entered into the cell with the conditional formatting. Obviously, when the data is entered the two cells are no longer equal and it changes color based on the condition being true (blank<>data entered). How can I keep it from changing color if the reference cell is blank or only allow it to change color if the reference cell has data entered in it?
    Last edited by damalco; 07-09-2010 at 10:17 AM.

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Use Conditional Formatting When Reference Cell Not Blank

    =or(<current criterion>,<is blank>)

    hth
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    07-07-2010
    Location
    Emporia, KS
    MS-Off Ver
    Excel 2000
    Posts
    5

    Re: Use Conditional Formatting When Reference Cell Not Blank

    Quote Originally Posted by Cheeky Charlie View Post
    =or(<current criterion>,<is blank>)

    hth

    I tried your suggestion in the conditional formatting dialog box in various forms and it did not work. I'm not sure I understand where and how exactly I should enter that condition.

    Written in code format, I am trying to do the following:

    IF reference cell=blank OR reference cell=this cell THEN no color change; IF reference cell<>blank AND reference cell<>this cell THEN change color.

    Sorry, I'm an idiot and may not have explained it well enough originally.

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Use Conditional Formatting When Reference Cell Not Blank

    This:
    IF reference cell=blank OR reference cell=this cell THEN no color change; IF reference cell<>blank AND reference cell<>this cell THEN change color.
    Appears to be a dual statement - I take it you only want one condition to fire or not?
    On that basis:
    cell with formatting = A1
    cell to match = B1
    conditional format condition:
    =and(A1<>B1,B1<>"")

    hth

  5. #5
    Registered User
    Join Date
    07-07-2010
    Location
    Emporia, KS
    MS-Off Ver
    Excel 2000
    Posts
    5

    Re: Use Conditional Formatting When Reference Cell Not Blank

    Quote Originally Posted by Cheeky Charlie View Post
    This:
    IF reference cell=blank OR reference cell=this cell THEN no color change; IF reference cell<>blank AND reference cell<>this cell THEN change color.
    Appears to be a dual statement - I take it you only want one condition to fire or not?
    On that basis:
    cell with formatting = A1
    cell to match = B1
    conditional format condition:
    =and(A1<>B1,B1<>"")

    hth

    I finally figured out how to make it work from your original post. I was trying to use the "Cell Value Is" rather than the "Formula Is" option in the conditional formatting dialog box. However, it does not recognize a space surrounded by quotes (" ") as "blank." I had to use the condition that the cell is not equal to zero (B1<>0) instead.

    Thanks for your help, it got me down the right path.

  6. #6
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Use Conditional Formatting When Reference Cell Not Blank

    No probs, if you don't include the space between the blanks that will work too - in some situations the difference is significant, but probably not here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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