+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting Looking through dynamic range

  1. #1
    Registered User
    Join Date
    10-01-2012
    Location
    Indianapolis, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    51

    Conditional Formatting Looking through dynamic range

    Hey guys, I am building an excel scheduling calendar and can't figure out one of the steps. I need to look through 21 days into the future to see if the first cell matches with any of the 21 future cells...in the same row. So May 1st look from May1st (D2) through May21st(X2) and the same thing for the other rows. Then it would need to look from May2nd through May22nd and so on and so forth.

    I've attached an example copy of the workbook

    Any help would be much appreciated.

    Thanks and KCCO!
    Attached Files Attached Files
    KCCO

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional Formatting Looking through dynamic range

    cf with =COUNTIF(OFFSET(D2,0,1,,21),D2)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    10-01-2012
    Location
    Indianapolis, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: Conditional Formatting Looking through dynamic range

    Ok, well my logic didn't exactly pan out. I tried to adapt this but it went down burning (It didn't like -21). I actually need this to look 21 days in the past and if it finds a match then the cell that's in the future (aka the later one) would turn red.

  4. #4
    Registered User
    Join Date
    07-05-2013
    Location
    Ottawa, Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional Formatting Looking through dynamic range

    Try this:

    =OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-21)=INDIRECT(ADDRESS(ROW(),COLUMN()))

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional Formatting Looking through dynamic range

    try in d2
    =ISNUMBER(MATCH(D2,OFFSET(D2,0,MAX(-COLUMN(A1)-1,-21),,MIN(COLUMN(A1)+1,21)),0))

  6. #6
    Registered User
    Join Date
    10-01-2012
    Location
    Indianapolis, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: Conditional Formatting Looking through dynamic range

    Martin, that's perfect! Thank you so much.

+ 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