Change color if less than or greater than

Xirom431

Board Regular
Joined
Dec 2, 2010
Messages
102
Hi,

I have this spreadsheet. I would like to have the % Completion column change to red letter if it is less than Target column and green if it is equal or greater than Target. Thanks and I use Office 2010.

<TABLE style="WIDTH: 215pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=286><COLGROUP><COL style="WIDTH: 46pt; mso-width-source: userset; mso-width-alt: 2230" span=3 width=61><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 3766" width=103><TBODY><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 46pt; HEIGHT: 15.75pt; BORDER-TOP: red 0.5pt solid; BORDER-RIGHT: red 0.5pt solid" class=xl72 height=21 width=61>Target</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; WIDTH: 46pt; BORDER-TOP: red 0.5pt solid; BORDER-RIGHT: red 0.5pt solid" class=xl72 width=61>Actual</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; WIDTH: 46pt; BORDER-TOP: red 0.5pt solid; BORDER-RIGHT: red 0.5pt solid" class=xl72 width=61>Planned</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; WIDTH: 77pt; BORDER-TOP: red 0.5pt solid; BORDER-RIGHT: red 0.5pt solid" class=xl72 width=103>% Completion</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>63</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>84.0%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>62</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>82.7%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>71</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>94.7%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>50</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>66.7%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>63</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>84.0%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>32</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>42.7%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>55</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>73.3%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>45</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>60.0%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>60</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>80.0%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>100.0%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>21</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>28.0%</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73 height=22>90</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>31</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl73>75</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl74>41.3%</TD></TR></TBODY></TABLE>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Should be able to use conditional formatting.

Go to Conditional Formatting, select new rule, then select Use a formula to determine which cells to format.

Given your data above, and that data starts in A1, apply this formatting formula to column to column D.

Green: =if($D2>=$A2/100)
Red: =if($D2<$A2/100)

Best of luck!
Excel VBA Guru
 
Upvote 0
Conditional formating, use a formula

for green the formula is "=$A2<=$D2" over the range =$D$2:$D$12
for red it is "=$A2>$D2" over the same range
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,248
Members
452,900
Latest member
LisaGo

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