Excel '07 Conditional Formatting, need help!

Soldato
Joined
17 Dec 2006
Posts
8,245
Hi :)

I put this in the programming section as I think it might have to entail programming to get it do what I want it do (ie. VB) but maybe not. Anyway, I'll give an image example of my worksheet:

s2u0p0.jpg


The cell that is coloured with a red fill has three conditional statments in it, which are:

If highlighted cell value is greater than C2 then fill is green
If highlighted cell value is less than C2 then fill is red
If highlighted cell value is equal to C2 then fill is blank

So basically if "6" in this case is lower than "9" then fill the cell red, which it has done. But how do I copy this conditional format to all the other cells, ie: D2, F3, H2, B2, D3 and so forth (the first number of every group on every row)... when I tried to copy + paste the cell to another one I thought that Excel would automatically change the value itself of the number it was look at, but it doesn't and I copy it, it looks like this:

a3h9jb.jpg


Which is wrong because each of the copied cells is still using C2 for it's original value, instead of the value of the cell to the right of it, so looking like this would be correct (I just manually coloured all the cells for the example):

eqxyps.jpg


Is there an easy way to do this, or do I have to manually create hree conditional format rules for every single cell? (which would be very harsh, because the screenshots are just examples and the proper workbook has hundreds of columns)

Cheers!
 
Umm, look into absolute/relative cell references. I'm not sure on what it is your trying to do, but if you have a formula with a cell reference and you want that to change to the next cell to the right everytime (thats what I'm getting from your description) then the cell reference in your formula would need to read C$2 (rather than C2) and then copy it across. Or $C2 and copy it down whichever way your doing it.

Basically the dollar sign before the 2 means that it always looks at row 2, but then increments the column.

If you didn't understand this don't worry, I don't think I explained it very well :o

I'm doing a module on spreadsheet modelling at uni at the moment, really enjoying it :)

EDIT

Reading it again, what you need to do is create the formula in B2 like I said above, making sure that the refernece reads $B2 and copy it down. You'll have to do this for every column though (B,D,F and so on), but thats better than every cell. Someone else might know a way of doing it quicker.
 
Last edited:
Back
Top Bottom