+ Reply to Thread
Results 1 to 4 of 4

formula needed for condition 2 of conditional formating

  1. #1
    Forum Contributor
    Join Date
    09-04-2006
    Posts
    117

    formula needed for condition 2 of conditional formating

    I have created a conditional format that highlights a series of cells red when 2 dates are 14 days apart. =OR(($H$22-$I$22+1)>14,($I$22-$H$22+1)>14)

    However as is now the formula is making all of the empty cells red. I'm trying to prevent this with condition 2. But I dunno what that would be. I want the empty cells, f12:i50 left alone unless there are dates in the h and i columns that are 14 days apart.

    condition 1 = make cell f 12:I12 red if h12 and i12 are 14 days apart (example)
    condition 2= ignore condition 1 if h column has no date (i column will always have todays date, h column is inputed by user).
    Last edited by Don Juan; 09-10-2006 at 04:57 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Select columns F to I. Then go to Format > conditional formats and enter

    =IF(AND($H1<>"",$I1<>""),OR(($H1-$I1+1)>14,($I1-$H1+1)>14),"")

    It looks down from row one and if criteria is meet changes only those cells.

    Let me know if it works

    VBA Noob

  3. #3
    Forum Contributor
    Join Date
    09-04-2006
    Posts
    117

    works good but

    formula worked great. Only prob is (and it was doing it before too) when I test the formula and say it removes a red highlight from the 3 side by side cells only 2 of the cells goes back to normal and 1 stays red, until I hit f9 (which is what generates my watch bill) I guess it refreshes it or something but anyhow, how do i get it to automatically refresh itself so all the red goes away or vice versa (all the red appears)?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Did you check Tools > Options > Calculation > Auto is ticked

    VBA Noob

+ 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