Conditional Formatting with Multiple Rows

Spreadsheetz

New Member
Joined
Jun 12, 2016
Messages
22
Hi There,

Hoping this is easier than I'm making it..

I'm trying to conditionally format columns based on the sum of multiple rows.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Jeff[/TD]
[TD]John[/TD]
[TD]Jack[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]

The formatting I'm looking to see is: if row2+row3>2, then green; if row2+row3=2, then orange; if row2+row3<2, then red.

I would imagine it's easy to create a conditional formatting formula to do this, but I cannot figure out how to have a sum of columns apply to a condition in this way. Any help would be appreciated!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Perhaps this:

Select your entire range, then make these three CF rules:

=SUM(A$2:A$3)>2 format green
=SUM(A$2:A$3)=2 format orange
=SUM(A$2:A$3)<2 format red
 
Upvote 0
You need 3 different rules

Select A1:C3 being A1 the active cell


Rule 1 (green)
Use this formula in CF
=SUM(A$2:A$3)>2
Format button and pick format: Fill --> green


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD="bgcolor: #92D050"]
Jeff​
[/TD]
[TD="bgcolor: #92D050"]
John​
[/TD]
[TD]
Jack​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD="bgcolor: #92D050"]
3​
[/TD]
[TD="bgcolor: #92D050"]
0​
[/TD]
[TD]
1​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD="bgcolor: #92D050"]
3​
[/TD]
[TD="bgcolor: #92D050"]
3​
[/TD]
[TD]
0​
[/TD]
[/TR]
</tbody>[/TABLE]


Do the same for the others rules adjusting the formula

Hope this helps

M.
 
Upvote 0
This is super helpful - thanks!!

I'm almost where I need to be.. 2 questions though.

1) When I do this, the cell in row 2 is the only cell which takes on the condition color. I have the entire column selected, and the show formatting rules option is set to "current selection." Any idea how to make this apply to the whole column?
2) Is there a quick way to apply this condition to many rows? Or is it a matter of manual entry per column that needs the formatting?

Thanks!
 
Upvote 0
You can apply this to as many rows/columns as you choose. Just make sure you select the whole area before you create/apply the rule. I'm not sure about 1) though. When I tested the formula, it highlighted all the cells in the column(s) that matched the criteria.

The only thing I can think of for 1) is that you didn't have the entire column/rows selected that you want to apply the rule to.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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