+ Reply to Thread
Results 1 to 10 of 10

read date and highlight if a month passed

  1. #1
    Registered User
    Join Date
    07-01-2006
    Posts
    40

    Arrow read date and highlight if a month passed

    how would you read value from a cell (which is a date) and apply conditional formating based on that value + 30 days?

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by pelachrum
    how would you read value from a cell (which is a date) and apply conditional formating based on that value + 30 days?
    Select the range required, then Format, Conditional Format, Formula is:

    =A1<(NOW()-30)

    and set the required pattern colour.

    note, A! = the highlighted (selected) cell in your range.

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    07-01-2006
    Posts
    40
    thanks,
    i've actually come up with =NOW()-G20>30 in the meantime but...
    i need it to be dynamic so instead of G20 (which is my cell at this moment) I need it to be =NOW()-[this given date that's entered in this cell]>30

    how do I phrase this so tha Excel understands?
    in other words how do I make Excel read what's in there now
    Last edited by pelachrum; 10-23-2006 at 02:26 AM.

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by pelachrum
    thanks,
    i've actually come up with =NOW()-G20>30 in the meantime but...
    i need it to be dynamic so instead of G20 (which is my cell at this moment) I need it to be =NOW()-[this given date that's entered in this cell]>30

    how do I phrase this so tha Excel understands?
    in other words how do I make Excel read what's in there now
    I thought that's what I had posted, but in a forum the cell A1 is always the 'assumed' cell of reference


    =A1<(NOW()-30)

    To apply this to a range see my first post.

    ---

    note, I would reccommend the formula that is easy to understand and Says whet you Mean

    =NOW()-G20>30

    may seem to be confusing to you later.

    =G20<(NOW()-30)

    is more easy to understand next year when you are trying to work out what you did.
    Last edited by Bryan Hessey; 10-23-2006 at 03:16 AM.

  5. #5
    Registered User
    Join Date
    07-01-2006
    Posts
    40
    I see what you're saying but it also highlights empty cells as if it treats a cell without data the same as one with date past 30 days. can that be addressed?

  6. #6
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    =AND(A1<(NOW()-30),A1<>"")

    As Bryan pointed out ... A1 is the generic cell to be replaced by your cell

    HTH
    Carim

  7. #7
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Carim
    =AND(A1<(NOW()-30),A1<>"")

    As Bryan pointed out ... A1 is the generic cell to be replaced by your cell

    HTH
    Carim
    Another option if you are doing a range, is to exclude 'real' numbers and test for just dates by selecting the range in which your dates might occur, then (with A1 as the active cell):

    =AND(A1>30000,A1<(NOW()-30))

    which dates back to Feb '82 from 30 days ago, but ignores most numeric value.

    (note: whilst we use the generic A1 you can select any range, but adjust the formula to suit, so if you select G2 to H19 with G2 as the active (odd-colour = highlighted) cell, use the formula =AND(G2>30000,G2<(NOW()-30))
    ---

  8. #8
    Registered User
    Join Date
    07-01-2006
    Posts
    40
    all right, this works great thank you guys, if I could bother you about one more thing...

    i want the formating like described above but NOT if another cell (H) in the same row is filled with data.

    ie.
    if my range is in the G column and the data in G15 for instance is past 30 days (therefore it's formated) and I enter data in H15, the formating in G15 resets to default.

    thank you

  9. #9
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by pelachrum
    all right, this works great thank you guys, if I could bother you about one more thing...

    i want the formating like described above but NOT if another cell (H) in the same row is filled with data.

    ie.
    if my range is in the G column and the data in G15 for instance is past 30 days (therefore it's formated) and I enter data in H15, the formating in G15 resets to default.

    thank you
    My preference would be to move your current condition (for G) to Condition 2, and re-set condition 1 with a H15 test with no format set, thus, only if the first condition fails does the current (new Second) condition come into force to colour the cell Green.

    =H15<>""
    no format

    etc

    (the other option is to include another 'And' on the current condition, but it could start to look messy very quickly if you later decide on options for column H entries)

    hth
    ---
    Last edited by Bryan Hessey; 10-28-2006 at 07:57 PM.

  10. #10
    Registered User
    Join Date
    07-01-2006
    Posts
    40
    worked

    thank you all

+ 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