# Conditional Formatting

#### Kanty

##### New Member
Hello!
I have two columns. Lets say column A and column B.
In column B I have positive, negative and nul prices.
If cell B1 has a positive price, I want cell A1 to have green colour.
If cell B1 has a negative price, I want cell A1 to have red colour.
If cell B1 has a zero price, I want cell A1 to have yellow colour.
And I want to do this for all the cells of A column.
Can it be done automatically or I have to do it one by one?

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

#### Kanty

##### New Member
Ohhh!Please I need a answer ASAP cause it is for a project...and I have a deadline for tommorrow!Thank you very much!

#### Weaver

##### Well-known Member
does the data start on row 1? This is important

If it does then

1. select all the cells in column A as far down as the data in Column B goes
2. colour them all red
3. select conditional formatting
4. for condition 1, select 'formula is' and type =B1=0
5. set the format to pattern = yellow
6. for condition 2, select formula is and type =B1>0
7. set the format for green
8. note if your data/selection starts on any row other than 1, change the formulas accordingly
9. start earlier next time!

#### Kanty

##### New Member
1)Thank for the quick response!
2)I promise I ll be a good girl if I ll finish this one in time!
3)My data starts on row 2.
4)Do I have to do it one by one???

I tried to do the same....like =B2=0 but it doesnt work....
is there a formula to do it all at once???
like for every negative price of the column B the price of the column A has to take red colour????but for all the cells???

#### Weaver

##### Well-known Member
The idea was to set them all to red, then the conditional formatting only has to have 2 conditions, one for +ve and one for zero, since all cells are going to be coloured in.

Did you select all the cells in A, from A2 down before you started?

Last edited:

#### Kanty

##### New Member
Ok!
Due to you I ll be a good girl from now and on!
Thank you sooo much!

1,102,042
Messages
5,484,348
Members
407,437
Latest member
alfaroM

### This Week's Hot Topics

• Finding issue in If elseif else with For each Loop
Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
• MsgBox Error
Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
• CELL FORMAT - IF CONDITION
My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
• Show numbers nearly the same
Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...