LookUp and then format a particular cell...

ran_heath

New Member
Joined
Jan 10, 2006
Messages
13
How do I look up the current month and then shade the box red if the current month APC or PPC is less than 80% of my target total (PGA)? I can change each month red via the conditional formating; however, I need this box to turn red.

EXCEL1.jpg


Thank You in advance...
 

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.

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Try this formula

=OR(INDEX(D7:O7,MATCH(TEXT(TODAY(),"mmmm"),D3:O3,0))< C7*0.8,INDEX(D8:O8,MATCH(TEXT(TODAY(),"mmmm"),D3:O3,0))< C8*0.8)
 

ran_heath

New Member
Joined
Jan 10, 2006
Messages
13
Hmmm...I think I was making things wayyy to complicated...lol I was trying to solve in VBA... lol...

This is my box shader...

Sub ShadeBox()
Range("H10:K10").Select
Selection.Interior.ColorIndex = xlNone
Dim rng As Range
Set rng = Sheets("TEST").Range("H10")
If Range("d7").Value <= Range("C7").Value Or Range("D8").Value <= Range("c8").Value Then rng.Interior.ColorIndex = 3
End Sub
 

ran_heath

New Member
Joined
Jan 10, 2006
Messages
13
It returns the values True or False... How do you make the cells change colors? I tried conditional formating, but it stays red for both True and False...weird...
 

Forum statistics

Threads
1,136,430
Messages
5,675,803
Members
419,586
Latest member
RoteichA

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
Top