Conditionally format group of cells into 3 equal groups based on percentage

sdoppke

Well-known Member
Joined
Jun 10, 2010
Messages
647
Hi everyone, im looking for some advanced conditional formating help. :)

I am trying to take a group (range) of cells and conditionally format them into 2 colors based on an even percentage (33% each) the size (range) of the group will never be the same. Here is an example of some cells.
<TABLE style="WIDTH: 47pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=63><COLGROUP><COL style="WIDTH: 47pt" width=63><TBODY><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 47pt; HEIGHT: 10.5pt; BORDER-TOP: white 0.5pt solid; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14 width=63>$26,187</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$25,941</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$23,097</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$18,145</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$17,510</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$16,669</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$16,617</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$15,844</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$14,544</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$13,952</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$13,810</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$12,312</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$1,546</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$1,079</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$479</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$200</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR><TR style="HEIGHT: 10.5pt; mso-height-source: userset" height=14><TD style="BORDER-BOTTOM: white 0.5pt solid; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 10.5pt; BORDER-TOP: white; BORDER-RIGHT: lime 0.5pt solid" class=xl85 height=14>$0</TD></TR></TBODY></TABLE>


To make matter worse... i need to be able to not include the cells with "$0" in the range.

Thanks everyone in advance for any help.

sd
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

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