Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example, if A1 and A2 are both positive, then I want A3 to be green. Also, if A1 and A2 are both negative, then I want A3 to be green as well.

Is there a way to do this? I'm using excel 2010

share|improve this question

You can just use conditional formatting with the following formula:


To do so, select Cell A3, go to the Home tab and select Conditional Formatting > New Rule. Then select Use a formula to determine which cells to format, enter the formula above and pick up the color you want for your background.

share|improve this answer

Yes, you can use conditional formatting with an if statement.

Let me show you how. Please review the image first:

enter image description here

So, the formula in C1 is

=IF(OR(AND(A1<0, B1<0), AND(A1>0,B1>0)),"Match","")

which is copied down to C3.

Then, I select the C column and click on the Home tab -> Conditional Formatting -> New Rule.

I select Format only cells that contain

From the first drop down menu, select "No Blanks" then click the Format button. Open the Fill tab and select green (remember what green you select). Then, if you want to remove the text I suggest you open the font tab and change the font colour to the same green.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .