Highlighted
New Contributor

# Conditional formating on sum of 2 cells

Hi.  I don't see the answer to my question -

I am creating a spreadsheet and want to add 2 cells - eg. A34 (revenue) minus A35 (expenses) and I want A36 to be red if I get a negative number (revenue is less than expenses) and green if I get a positive number (revenue is greater than expenses).  How do I do this?

Thanks!

3 Replies
Highlighted

# Re: Conditional formating on sum of 2 cells

Hi @jsiegs

So to get the data you need in A36 use this

=sum(A34-A35)

Then you can apply conditional formatting. To do so, select cell A36, and in the ribbon, select conditional formatting > new rule > Format only cells that contain > Cell value > greater than or equal to >0. Than select Format > Fill tab > pick a color (green in this case)

Repeat for cell value less than "0" with the color red.

That should do.

Ben

Highlighted

# Re: Conditional formating on sum of 2 cells

@jsiegs  if the cell A36 is going to be the difference in A34 and A35 then yes as @Bennadeau  mentioned make A36

``=A34 - A35``

and there are preset conditional formatting options you can use.

But, if A36 is something else entirely and you only want the conditional formatting on that cell and not the formula, you can do that too.

In conditional formatting you have the option for a custom formula and enter

=(A34-A35)<0  and define the formatting to be red fill

you can then either make the default fill green by formatting the cell that way or create a second conditional formatting for =(A34-A35)>0 and define it with green fill

If you need more help or have problems I'd be happy to give a sample.

Highlighted