Conditional format cells in column, RAG, based on preceding cell value
I have an excel sheet containing a variable number of columns (currently G3:AX30) I want to fill each cell with a colour (Red Yellow or Green) based on whether the cell value is higher than, the same as or lower than the value in the cell above it.
My initial attempts using CF in 2003 all seem to point at G3 and use this value as the conditon for applying the conditonal formatting instead of looking at the cell value and comparing it with the value in the cell above it.
Re: Conditional format cells in column, RAG, based on preceding cell value
Thanks for the assistance. That's almost what I'm after. I forgot to mention (which always complicates things) that not all the cells in each column in are filled consecutively with a value. If there is no value in the cell then it should remain unfilled - but I still need any further values to look at the last positive value to make the comparision.
Hope this makes sense.
As before I'm not sure about the top row but apply these to G4:AX30. Blank cells should be ignored although it recognizes zeros. Also the Match function looks for an extreme value of 10^10, I'm assuming there are no numbers larger than this in the range, if so make it bigger.
Re: Conditional format cells in column, RAG, based on preceding cell value
DBY
This is great stuff. It almost works as advertised... (but this is no fault on your part and the exceptional work you have done for me). When implimenting your solution, it didn't appear to work correctly at first, but on investigation it seems that my 'blank' cells actually contain a hidden zero.(They are populated from elsewhere by a complex formula).
In your CF formula I substituted "" for the 0 which had the appearance of working but cells that were occupied further down the columns were showing incorrect colour formatting. I believe that this is due to the fact that the cell is not actually empty but contains a hidden value of zero which is then used as the comparitor in the CF formula rather than the last proper number.
Just need to find a way to strip those zero's out now.
I'm not sure if I should close this as solved or if the hidden zero's can be taken into account in the CF formula.
Re: Conditional format cells in column, RAG, based on preceding cell value
Thanks CANAPONE. I'd been working on a possible solution before I saw your reply but this seems to work brilliantly. I'd been trying to suppress the CF when encountering zeros as well as blank cells, if this is needed, a small addition to the 'lesser than' AND criteria seems to work:
Re: Conditional format cells in column, RAG, based on preceding cell value
Great work guys. I don't know how you work this magic... it's all voodoo to me... but whatever it is you do, keep doing it. People like me will always be indebted to people like you who offer their skill, expertise and time to assist us lesser mortals.
Bookmarks