conditional formatting based of sum of CHANGING range

thegurumonkey

New Member
Joined
Sep 18, 2015
Messages
13
Hi

This is some very weird behaviour. A formula shows the correct 'TRUE/FALSE' in a helper column, but doesn't work in conditional formatting!

i'm trying to colour items in a column from the row of today (whose number is in $b$1) to the row where we run out of stock (number of items in stock defined in rr$1)

My initial effort was:

=SUM(INDEX(RR:RR,$B$1):RR159)<RR$1

is the version of the formula applied to cell rr159

which does the trick in cells, but won't work in conditional formatting. a warning comes up, but i don't understand which part of this type of formula it won't accept.


Anyway, though i usually try to avoid indirect, i got it to work for this column with:

=SUM(INDIRECT("rr"&$B$1&":"&"rr"&ROW(rr159)))<rr$1

but then when i made it reference the column letters (in row 255) so it could be applied across multiple columns thusly:

=AND( SUM(INDIRECT(rr$255&$B$1&":"&rr$255&ROW(rr159)))<rr$1 ,COUNTBLANK(rr$1)=0)

it applies said formula to the whole column, despite the same formula showing the correct '"TRUE/FALSE" values when applied to a helper column beside the data...

I'm stumped... any help muchos appreciatos
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
might want to take a look at your absolute reference compared to mixed references...

example: =SUM(INDEX(RR:RR,$B$1):RR159)<rr$1
<--- should this be B1 instead of $B$1?? I don't know, just a thought.</rr$1
 
Upvote 0
Thanks for the suggestion, but that won't it. It looks wrong at a glance, but b1 has the row number of today on it, so it may be an absolute reference.
All the $ are right. As i said, the formula actually works when played into a helper column. Something wierd in conditional formula.
Any more for any more? Thanks
 
Upvote 0
It's circular refetencing even possible for conditional formatting? Each cell often references the value in itself in order to define the format.
That said, oops, I have failed to paste the whole formula. My bad.

The initial formula should have been
=SUM(INDEX(RR:RR,$B$1):RR159)<rr$1

and hence generates a true or false rather than a number.
When entered as a conditional formatting formula, it says "you can't use ranges or [something] or [something else] in conditional formatting."
I'm in bed now or I'd quote the warning pop-up more exactly for you. Sorry
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top