+ Reply to Thread
Results 1 to 12 of 12

Conditional formatting-have the formula increment to test the relevant rows

Hybrid View

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Conditional formatting-have the formula increment to test the relevant rows

    Hi everyone,

    I'm trying to apply conditional formatting which checks the current date and then looks at the date some work should be completed, highlighting the cell with the due date (D5) in yellow as a reminder.

    I've used the formula - =AND($K5="",$D5>"", (TODAY()-$D5)>-3)

    And it works just fine on row 5.

    But I want to copy the conditional formatting to the next 200 rows so that each formula refers to the data in the relevant row - 6, 7, etc. up to 204.

    Whether I copy and paste or use format painter down the column, the formula keeps referring to row 5.

    How do I get the formula to increment the row number in the formula to test each relevant row's data?

    Thanks

  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-have the formula increment to test the relevant rows

    Your formula should works. Looks ok. It's really strange..

    Can you upload a small sample workbook?
    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 Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Conditional formatting-have the formula increment to test the relevant rows

    Formula: copy to clipboard
    $D5>""


    The above part will result false when D5 is entered with Numeric Value. So it should be
    Formula: copy to clipboard
    =$D5<>""


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    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-have the formula increment to test the relevant rows

    @ Sixthsense

    Correct. But OP says that works for row 5. So?

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Conditional formatting-have the formula increment to test the relevant rows

    @Fotis1991,

    I Added A screnshot in Post #5 for easy understanding

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Conditional formatting-have the formula increment to test the relevant rows

    It just show like that but move based on the range defined. Refer the attached screenshot for details.CF-Clarification.JPG

  7. #7
    Registered User
    Join Date
    09-14-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Conditional formatting-have the formula increment to test the relevant rows

    Thanks for such a quick response.

    I've attached a sample spreadsheet. Trial Conditional formatting.xlsx

    The concept is that if the work does not have (in column G) a date completed, the formula checks to see the due date in column D and if that has already passed, sets a red colour. If it is less than three days away, it sets a yellow colour.

    But, when I look at the formula for cells other than the one I started with – D5, they all have references as if they are checking row 6.

    However, if you look at the actual colours that are set in the cells, the formula seems to be working! That is, overdue dates are red, dates less than three days away our yellow and ones other than that aren't coloured.

    It's nice that it's working – but somewhat disconcerting that the formula doesn't seem to reflect what it should do, leaving me in a bit of a quandary.

    Tim

  8. #8
    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-have the formula increment to test the relevant rows

    ..But, when I look at the formula for cells other than the one I started with – D5, they all have references as if they are checking row 6.
    It's because in D5 using same formula, as the others, your range in ONLY for D5.

    Starting from D6 until the end D204...same formula for range D6:D204.

    Use range D5:D204 for all d rows..

  9. #9
    Registered User
    Join Date
    09-14-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Conditional formatting-have the formula increment to test the relevant rows

    OK - I've now got the same formula covering D5 to D204. And I've added in the suggestion of Sixthsense.

    And it's all working - thanks, Fotis,( again)!

    But - and this is probably due to my lack of understanding of Excel conditional formatting - why does each line of column D have the same formula- =AND($G5="",$D5<>"", TODAY()-$D5>0)?

    I expected that the formula would change line number as it progresses down the sheet.

    Is this due to specifying the range as $D$5:$D$204 - following which Excel states the first line's formula in the formula bar, but applies the current line number when calculating?

    It's now a question solely to improve my knowledge, but if you have time, it would be greatly appreciated.

    Tim

  10. #10
    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-have the formula increment to test the relevant rows

    Hi Tim. Thanks for your kind words.

    ..but applies the current line number when calculating?
    Yes. Excel does exactly this.

  11. #11
    Registered User
    Join Date
    09-14-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Conditional formatting-have the formula increment to test the relevant rows

    Aaaah - thank you Fotis; once again you've helped solve my problem – and I've learnt more about Excel.

    I hope you have a great day.

    Tim

  12. #12
    Registered User
    Join Date
    09-14-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Conditional formatting-have the formula increment to test the relevant rows

    Aaaah - thank you Fotis; once again you've helped solve my problem – and I've learnt more about Excel.

    I hope you have a great day.

    Tim

+ 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