Conditional Format a row of values that sum up to but not over x

wagsme

New Member
Joined
Jun 4, 2018
Messages
1
I have a row of values B:W that I would like to highlight if they sum up to a value in column A. And copy that row CF to 600 rows below. A visual of how many days it took a product to sell through.

[FONT=&quot]9[/FONT]​
[FONT=&quot]18[/FONT]​
[FONT=&quot]29[/FONT]​
[FONT=&quot]4[/FONT]​
[FONT=&quot]0[/FONT]​
[FONT=&quot]9[/FONT]​
[FONT=&quot]2[/FONT]​
[FONT=&quot]18[/FONT]​
[FONT=&quot]16[/FONT]​
[FONT=&quot]4[/FONT]​
[FONT=&quot]0[/FONT]​
[FONT=&quot]5[/FONT]​
[FONT=&quot]28[/FONT]​
[FONT=&quot]31[/FONT]​

<tbody>
[TD="bgcolor: #BEC0BF"] [FONT=&quot]sales units [/FONT]
[/TD]
[TD="bgcolor: #BEC0BF"]
[FONT=&quot]1/1/18[/FONT]​
[/TD]
[TD="bgcolor: #BEC0BF"]
[FONT=&quot]1/2/18[/FONT]​
[/TD]
[TD="bgcolor: #BEC0BF"]
[FONT=&quot]1/3/18[/FONT]​
[/TD]
[TD="bgcolor: #BEC0BF"]
[FONT=&quot]1/4/18[/FONT]​
[/TD]
[TD="bgcolor: #BEC0BF"]
[FONT=&quot]1/5/18[/FONT]​
[/TD]
[TD="bgcolor: #BEC0BF"]
[FONT=&quot]1/6/18[/FONT]​
[/TD]

[TD="bgcolor: #DCDCDC"]
[FONT=&quot]22[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]10[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]24[/FONT]​
[/TD]
[TD="bgcolor: #DCDCDC"]
[FONT=&quot]45[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]9[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]19[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]6[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]7[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]8[/FONT]​
[/TD]
[TD="bgcolor: #DCDCDC"]
[FONT=&quot]32[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]5[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]22[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]7[/FONT]​
[/TD]
[TD="bgcolor: #DCDCDC"]
[FONT=&quot]76[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]22[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]11[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]22[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]14[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]44[/FONT]​
[/TD]
[TD="bgcolor: #DCDCDC"]
[FONT=&quot]23[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]9[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]6[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]9[/FONT]​
[/TD]
[TD="bgcolor: #DCDCDC"]
[FONT=&quot]88[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]44[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]22[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]12[/FONT]​
[/TD]
[TD="bgcolor: #FFFC66"]
[FONT=&quot]34[/FONT]​
[/TD]
</tbody>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
OK, assuming that your data starts in cell B2, you can first highlight ALL of column B (as I don't think there would be any situation in which that should NOT be highlighted, right?).

Then, select the range C2 down to the last row and column of your data.
Then, apply this Conditional Formatting formula:
Code:
=OR(SUM($B2:C2)<$A2,AND(SUM($B2:B2)<$A2,SUM($B2:C2)>=$A2))
and choose the yellow highlighting option.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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