Hello,
I am looking for some help as to why my AND() conditional formatting does not work. I have an expandable data set (which is why K4 is an Offset function).
The K4 formula will always average the previous 5 yrs worth of data.
When I have conditional formatting for the Quarters, I want it to highlight when above the 5 year quarterly average (the SUM() in K4) BUT only if the quarter is within the past 5 years.
The Greater Than conditional formatting that I got to work is:
=B7>SUM(OFFSET($K$3,4,-6,1,5),OFFSET($K$3,8,-6,1,5),OFFSET($K$3,12,-6,1,5),OFFSET($K$3,16,-6,1,5))/((COUNTIF(OFFSET($K$3,4,-6,1,5),"<>0")+(COUNTIF(OFFSET($K$3,8,-6,1,5),"<>0")+(COUNTIF(OFFSET($K$3,12,-6,1,5),"<>0")+(COUNTIF(OFFSET($K$3,16,-6,1,5),"<>0"))))))
for the range: =$B$7:$I$7,$B$11:$I$11,$B$15:$I$15,$B$19:$I$19
When I try and add the AND() part to also have it work for being within the past 5 years, it fails.
=AND(B7>SUM(OFFSET($K$3,4,-6,1,5),OFFSET($K$3,8,-6,1,5),OFFSET($K$3,12,-6,1,5),OFFSET($K$3,16,-6,1,5))/((COUNTIF(OFFSET($K$3,4,-6,1,5),"<>0")+(COUNTIF(OFFSET($K$3,8,-6,1,5),"<>0")+(COUNTIF(OFFSET($K$3,12,-6,1,5),"<>0")+(COUNTIF(OFFSET($K$3,16,-6,1,5),"<>0")))))),OFFSET($K$3,0,-2)-(OFFSET($A$1,2,COLUMN(B7)-1))<6)
The 2nd argument in the AND() is: OFFSET($K$3,0,-2)-(OFFSET($A$1,2,COLUMN(B7)-1))<6. When I test this, it seems to work and returns the correct year, no matter which Quarter the formula references.
Hoping someone can assist. Thank you!
-bbkdude
Bookmarks