Conditional Formatting or VBA?

Cheryl4g

New Member
Joined
Jan 11, 2011
Messages
29
I have a scenario where I'm not sure what approach to use.

I have 4 criteria that can be either Green=3, Yellow=2 or Red=1
and I have 8 quarters from Jan 1 2011 to Dec 31 2012.

If the current date is 4/1/11 and the criteria is 3,3,3,3 then Q1 needs to be Green, ( or the blank cell below Q1, creating a color bar)
If the date is 4/1/11 and any of the criteria is a 2 then Q1 should be Yellow.
If any of the Criteria is a 1 then Q1 should be Red.

If the current date is 7/10/11 and the criteria is 3,2,3,1 then Q1 and Q2 should be Red.

What is the best way to tackle this logic?

I can get the color bar for the Quarters by using conditional formatting of =L5(cell of current date)> M5(last day of quarter 3/31/2011)

But I can't figure out how to include the logic for the criteria, to change the color to yellow or red if any of the criteria is a 2 or 1.

Any suggestions?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You have not said which cells the criteria are in.

Let's say, dates to compare are in L5 and M5 and your criteria is in cells N5,O5,P5 and Q5
your conditional format formula would be ~ for Q1 to make yellow, if any criteria is 2

=AND(L5>M5,OR(N5=2,O5=2,P5=2,Q5=2))

You can use more than 1 rule for Q1, just need to put them in priority order.

In your green conditional format all your criteria needs to = 3
so the formula for that would be ~ assuming criteria is where I said.

=AND(L5>M5,N5=3,O5=3,P5=3,Q5=3)

Using AND and the OR in the correct sequences with the correct bracketing will do all you need for your different combinations.

Cheers.
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

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