+ Reply to Thread
Results 1 to 3 of 3

Conditional formatting based on formula where cell references can change

  1. #1
    Registered User
    Join Date
    09-06-2018
    Location
    canada
    MS-Off Ver
    Microsoft office 365 pro plus
    Posts
    5

    Conditional formatting based on formula where cell references can change

    Hi,

    I have dates along row 8 and I want the rows above it (rows 3-7) to be conditionally formatted based on the date in row 8, for each column. Easy enough. I can do =AND(C$8>=DATE(2022,1,1),C$8<=DATE(2022,12,31)) in the conditional formatting formula and it works properly for all cells C3:P7. Now here is the kicker. I want to copy and paste this conditional formatting not just for C3:P7 but also C10:P13 (checking the date in row 14) eg I also have dates in row 14 and I want rows 11-14 to be conditionally formatted to look at row 14. And this repeats every 6th row enough times that I want to make the referenced cell in the formula to be based on a formula itself.

    If I try =AND(INDIRECT(ADDRESS(CEILING.MATH(ROW()-2,6,0)+2,COLUMN()))<=DATE(2022,1,1),INDIRECT(ADDRESS(CEILING.MATH(ROW()-2,6,0)+2,COLUMN()))<=DATE(2022,12,31)) it doesn't work properly. I think it doesn't like indirect in conditional formatting formulas but I'm not sure. Any ideas how I can accomplish my objective?

    Thanks.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: Conditional formatting based on formula where cell references can change

    Use the formula

    =YEAR(INDEX(C:C,INT((ROW()+3)/6)*6+2))=2022
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    09-06-2018
    Location
    canada
    MS-Off Ver
    Microsoft office 365 pro plus
    Posts
    5

    Re: Conditional formatting based on formula where cell references can change

    You're the man - thanks, Bernie!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-28-2015, 10:08 PM
  2. Replies: 2
    Last Post: 02-22-2015, 11:52 AM
  3. [SOLVED] Conditional formatting: Copying styles and formula, but with different cell references
    By tays01s in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-26-2013, 02:34 AM
  4. Cell references error with recorded Conditional Formatting (Formula) macro
    By nlexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2012, 01:38 PM
  5. Replies: 6
    Last Post: 03-06-2012, 11:11 AM
  6. Replies: 2
    Last Post: 09-20-2011, 12:32 AM
  7. conditional formatting to change colour of cell based on formula result
    By gideong in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-15-2009, 09:35 AM

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