Using excel 2010, I have used conditional formatting to highlight cells of one column if the value is greater then a second column. I would like to be able to generate a value of the total highlighted cells so I can calculate the percentage of those values. Here is an excerpt of what I am using in which I have been manually changing the "Higher In-House Value" number each time I come across one. Is there a function or code that I can use?Sheet1<table class="html-maker-worksheet" border="1" cellspacing="0" cellpadding="0"><thead><tr><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th></tr></thead><tbody><tr ><th>1</th><td style="text-align: center;;">Lot</td><td style="text-align: center;;">Received</td><td style="text-align: center;;">In-House</td><td style="text-align: center;;">Supplier</td><td></td><td></td><td></td><td></td></tr><tr ><th>2</th><td style="text-align: center;;">0225481</td><td style="text-align: center;;">4/28/2010</td><td style="text-align: center;;">80.0%</td><td style="text-align: center;;">80.2%</td><td></td><td style="text-align: center;;">Total # of Lots</td><td></td><td style="text-align: center;;">11</td></tr><tr ><th>3</th><td style="text-align: center;;">9224621</td><td style="text-align: center;;">7/20/2010</td><td style="text-align: center;;">81.0%</td><td style="text-align: center;;">80.7%</td><td></td><td style="text-align: center;;">Higher In-House value</td><td></td><td style="text-align: center;;">5</td></tr><tr ><th>4</th><td style="text-align: center;;">0225727</td><td style="text-align: center;;">7/20/2010</td><td style="text-align: center;;">82.0%</td><td style="text-align: center;;">81.2%</td><td></td><td style="text-align: center;;">% values higher In-House</td><td></td><td style="text-align: center;;">44.4%</td></tr><tr ><th>5</th><td style="text-align: center;;">0225505</td><td style="text-align: center;;">7/20/2010</td><td style="text-align: center;;">80.1%</td><td style="text-align: center;;">80.7%</td><td></td><td></td><td></td><td></td></tr><tr ><th>6</th><td style="text-align: center;;">0225440</td><td style="text-align: center;;">9/20/2010</td><td style="text-align: center;;">80.6%</td><td style="text-align: center;;">80.4%</td><td></td><td></td><td></td><td></td></tr><tr ><th>7</th><td style="text-align: center;;">0226035</td><td style="text-align: center;;">9/20/2010</td><td style="text-align: center;;">80.2%</td><td style="text-align: center;;">80.6%</td><td></td><td></td><td></td><td></td></tr><tr ><th>8</th><td style="text-align: center;;">0226013</td><td style="text-align: center;;">9/21/2010</td><td style="text-align: center;;">80.2%</td><td style="text-align: center;;">81.2%</td><td></td><td></td><td></td><td></td></tr><tr ><th>9</th><td style="text-align: center;;">0225505</td><td style="text-align: center;;">9/20/2010</td><td style="text-align: center;;">80.5%</td><td style="text-align: center;;">80.7%</td><td></td><td></td><td></td><td></td></tr><tr ><th>10</th><td style="text-align: center;;">0226013</td><td style="text-align: center;;">9/20/2010</td><td style="text-align: center;;">80.3%</td><td style="text-align: center;;">80.2%</td><td></td><td></td><td></td><td></td></tr><tr ><th>11</th><td style="text-align: center;;">0226013</td><td style="text-align: center;;">11/18/2010</td><td style="text-align: center;;">80.7%</td><td style="text-align: center;;">80.2%</td><td></td><td></td><td></td><td></td></tr><tr ><th>12</th><td style="text-align: center;;">0226201</td><td style="text-align: center;;">5/12/2011</td><td style="text-align: center;;">80.4%</td><td style="text-align: center;;">81.3%</td><td></td><td></td><td></td><td></td></tr><tr ><th>13</th><td style="text-align: center;;">1227068</td><td style="text-align: center;;">7/12/2011</td><td style="text-align: center;;">80.5%</td><td style="text-align: center;;">80.7%</td><td></td><td></td><td></td><td></td></tr><tr ><th>14</th><td style="text-align: center;;">1227399</td><td style="text-align: center;;">7/29/2011</td><td style="text-align: center;;">80.4%</td><td style="text-align: center;;">81.4%</td><td></td><td></td><td></td><td></td></tr><tr ><th>15</th><td style="text-align: center;;">1227399</td><td style="text-align: center;;">9/15/2011</td><td style="text-align: center;;">80.2%</td><td style="text-align: center;;">81.4%</td><td></td><td></td><td></td><td>Excel 2010<table ><tr><td style="padding:0.3em;border: 2px solid #000009;background-color:#FFFFFF;">
Excel Workbook
Cell
Formula
H2
=SUM(C2:C9999)
H4
=H3/H2
Worksheet Formulas
<br />
The formatting does change C3,C4,C6,C10 and C11 to yellow.
In H2, I'd use =COUNT(C2:C9999) rather than sum.
In H3, I'd ignore the conditional formatting color and test directly for the in-house being greater than supplier.
=SUMPRODUCT(--(C1:C9999>D1:D9999))
I guess I should proof my formula's before posting them. In my live version I do use count, however I have never used sumproduct and that works perfectly. Thank you.
Perhaps you can help me with my other problem. I had hoped the solution to this one would lead me to an easy fix with the second, and it probably is. Same situation, however the conditional formatting colors cells outside of a specific range. For example:
Excel Workbook
A
B
1
Low limit
6
2
High Limit
7
3
4
Lot#
Value
5
x
6.2
6
y
7.2
Sheet1
Excel 2010
Here cell B6 is highlighted because it falls outside the range of B1 and B2. I assume that I would have to nest an If statement into the sumproduct formula to get the same result as before. Any suggestions?
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.