+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Conditional Formatting Cells that contain formulas not working as intended

  1. #1
    Registered User
    Join Date
    04-09-2011
    Location
    DFW
    MS-Off Ver
    Excel 2007
    Posts
    22

    Conditional Formatting Cells that contain formulas not working as intended

    Good day all,

    I have two sets of conditional formating of cell colors for a single colum.

    The first (which works as intended) turn the cell blue when within a certain date range. This date range is calculated based on adding a number of days to todays date.

    The problem is that sometimes no date will be inputed in the refence cell for the formula. In this case the cell spits out a result for the formula of 2/4/1900. So an idea for a work around was to add a second conditional formatting rule that whenever this text was present (2/4/1900 resulting from not have a dates in the refence cells) the text would turn white along with the cell fill effectivly 'whiting out' the 2/4/1900 until a date was inputted in the refence cell.

    However, this desired effect does not happen. I would guess it has something to do with the fact that when you select the field in question, you do not see actual text but the formula. Is there a way not to see the erroneous date of 2/4/1900 when there is no date in the refence cell or get this conditional formatting to work?

    Thank you again.
    Last edited by markharper80; 04-29-2011 at 09:11 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting Cells that contain formulas not working as intended

    Can you upload an example speadsheet with cells that are set up the way you describe? (Go Advanced>manage attachments) It's hard to follow without the spreadsheet.
    If you can't do that, the actual conditional formula would be helpful.

    2/4/1900 corresponds to 35, Can you try that i.e.
    =A2=35 Format as white text
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Conditional Formatting Cells that contain formulas not working as intended

    Why don't you change the formulas to test for the date and if it's not there return a blank?

    Or

    Put CF in place to trigger if the cell value is less than an arbitrary number like 1000.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,074

    Re: Conditional Formatting Cells that contain formulas not working as intended

    You could use an AND condition. You don't specify the cells in question so it's difficult to offer a definitive answer ... but, something like:

    =AND(refcell<>"", your date formula (which works))

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    04-09-2011
    Location
    DFW
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Conditional Formatting Cells that contain formulas not working as intended

    Here is the dummy book...basically G4 is a bogus number since no date is input in D4. If there is a way to show G4 as a blank when no date is input in D4 then that would be preferable while still keepign the formula intact as eventually a date will be added to D4. But I have not been able to figure that out so instead I have added a conditional formating to 'white it out'. But the white out is not working.
    Attached Files Attached Files

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Conditional Formatting Cells that contain formulas not working as intended

    Following TMShucks suggestion, try this formula in G4 copied down

    =IF(D3="","",D3+35)

    Note that it's not "good practice" to use formulas like you have in F3, i.e. =TODAY()-C:C
    That might work but it's better to use the specific row number, i.e.

    =TODAY()-C3
    Audere est facere

  7. #7
    Registered User
    Join Date
    04-09-2011
    Location
    DFW
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Conditional Formatting Cells that contain formulas not working as intended

    Thanks all. =IF(D3="","",D3+35) worked like a charm. I have never used the IF function before in this way, its so simple and so effective. Great stuff!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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