PDA

View Full Version : Formatting a cell based on 2 cells.



kevvukeka
03-26-2013, 06:47 AM
Hi All,

I need some help with conditional formatting. I have data in 3 cells. for e.g Cell B1, Cell B2, Cell A2. I need to format Cell B1 background color to green if Cell B2="A" or Red if Cell A2="B". I have apply to this to other ranges too..

basically I need each cell in a column to compare with two other cells below it and format red or green.

Kindly help..

Thanks & regards,
Praveen

enrand22
03-26-2013, 10:15 AM
for conditional formating with formulas (find it at the end in more rules), you would need two, for example this formula could apply.

=if($b2=$a$2,true,false)
apply the background you want

you would play with the "$" as if it was a simple formula, in this example $a2$ will never change while you apply the format to the whole column b.

to match a cell with the lastone the formula would look like this.

=if(b5=b6,true,false)

*note: dont write "" in true and false.

kevvukeka
03-27-2013, 03:33 AM
Hi Enrand,

Thanks for the reply but i am not able to get the required output..

BAsically I need two condtionss to aplly for one cell.

For eg: I have data in column B. Under each numeric value i have a alphabet and if its absent here there will be alphabet in the cell adjacent to it. Its looks as below.

Column A Column B
21
B
45
A
62
B.

My data looks as above. I need to colour the cells in column B to Green if the alphabet below it is A or red if the alphabet adjacent to the below cell is B. Alpbahets are in the same row. Either of one of the alphabet is present but not both of them.

Please help as to how fix this...


Regards,
Praveen