Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel conditional formatting based on cell and adjacent cell values [closed]

Is it possible to format a cell in Excel based on the cell above it's value. Basically I'm compiling a spreadsheet and I want the cell to be highlighted in light green if the value has gone down since the entry above and I want it to go red if it has increased.

I'm sure its fairly simple but I just cant get it to work.

Any help would be greatly appreciated.

like image 555
Richard Newman Avatar asked Apr 23 '13 16:04

Richard Newman


People also ask

How do you conditional format in Excel based on adjacent cells?

Apply Conditional Formatting Based on an Adjacent Cell Say you want to highlight (in green) all cells where a cell from Column B has the same value in Column C. Select a range of data and in the Ribbon, go to Home > Conditional Formatting > New Rule.

Can you use conditional formatting based on relative cell references?

In Excel conditional formatting, cell references are relative to the top-left cell in the applied range . So, when making a new rule, you can simply pretend as if you are writing a formula for the upper-left cell only, and Excel will "copy" your formula to all other cells in the selected range.


1 Answers

Yes, all you need to do is to use Conditional Formatting with a formula.

For example, if the two cells are A1 and A2, with A2 being the cell you want to change color, then you would select A2 and choose Conditional Formatting from the Home ribbon. Then select New Rule and "Use a formula to determine which cells to format."

Then, in the formula bar that comes up enter =A2>A1 and choose the red fill as the format you want to use.

This only works one cell at a time; can't select a range of cell and expect each cell format to based on it's own adjacent cell

Then create another rule for cell A2 using the formula =A2<A1 and choose light green as the format.

enter image description here

like image 152
chuff Avatar answered Oct 14 '22 19:10

chuff