Conditional Formatting if the sum of two cells does not equal another cell

Joe94

New Member
Joined
Nov 19, 2010
Messages
20
DEFGHetc
38Budget Total350300400200etc
39Item 1200200300100etc
40Item 21501005050etc

<tbody>
</tbody>

Above is a small section of the spreadsheet I am working on. I am working on a budget and I want the cells for Item 1 and Item 2 to be formatted if they do not add up to the budget total.

Basically, I want the following:

IF(E39+E40)<>E38, then format E39 and E40
IF(F39+F40)<>F38, then format F39 and F40
and so on

I have got a lot of columns so I want to be able to highlight the whole row and conditionally format them all together.

I've been racking my brains all morning trying to figure it out so any help would be appreciated :)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Select E39:H40 (or whatever your last column is), and enter this Conditional Formatting formula:
Code:
=E$39+E$40<>E$38
and choose your highlighting color.

The key is to lock the row reference down with the "$", while allowing the column reference to float.
You can read more about those type of range references here: http://www.cpearson.com/excel/relative.aspx
 
Upvote 0
Wow so simple, I think I was over-complicating things as the formulas I were trying were far more complex! Thanks a lot!

Also, what a coincidence that our usernames are nearly identical :LOL:
 
Upvote 0
I've just taken another look at the output actually and this formula sadly isn't working. I have cleared all C-Formatting for these cells and re-tried but the formatting only seems to be affecting random cells. I have also tried F9 to recalculate and nothing.

I will try to post a picture and try to give some follow-up information
 
Upvote 0
I will try to post a picture and try to give some follow-up information

There are tools you can use to post screen images. They are listed in Section B of this link here:
http://www.mrexcel.com/forum/board-a...forum-use.html.
Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.

Note that these formulas are very dependent upon the ranges that you apply them to. In order to get them to work properly, you need to do the following:
- Select the range you want apply it to
- Write the formula as it applies to the very first cell in your selected range
- Use absolute/relative/mixed range referencing properly so that the formula will adjust properly for the other cells in your range

So, if anything is actually different from what you first posted, and how I told you to post the formula, proper adjustments need to be made.
So, did anything change?
What range did you select, exactly?
What formula did you enter, exactly?

 
Upvote 0
Ah OK the problem was I was not using the very first cell as per your second point. Now it seems the formula works perfectly. Thanks again for your help!
 
Upvote 0
You are welcome.

Yes, if it ever appears that the wrong cells are highlighted and are "random", it usually means that your selected range and formulas are not in alignment (so the highlighting is shifted/offset from the cells it should be highlighting).
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,959
Latest member
camelliaCase

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top