I have three different criteria in my Excel 2007 worksheet that I need compared use two columns of data. If any of the conditions are met I need to color the row yellow. For example:

If A2>30 color the row yellow or

If A2>15 and B2>62 color the row yellow or

If A2>5 and B2>60 color the row yellow otherwise leave the cell without formatting.The conditional formatting that I used in Excel 2003 is not working and I am not sure what to do. Do I need to have each condition as a separate rule or if I can include all three in a string, how do I connect them?

I used this formula in Excel 2010 and it seemed to work fine: =OR(A2>30,AND(A2>15,B2>62),AND(A2>5,B2>60))

However, I have a question.

Maybe my brain is just fried from a long day, but what is the point of the 2nd condition, A2>15 and B2>62?

When could A2>15 and B2>62 be TRUE, and A2>5 and B2>60

notbe TRUE?Doesn't the 3rd condition cover the 2nd one also?

Click Here Before Posting Data or VBA Code --->How To Post Data or Code.

Thank you! I had a formatting problem in the spreadsheet and when I fixed that it worked.

I'm glad you got it working, but I'm still confused by your 2nd condition. Why do you need that, considering that the 3rd condition covers every instance where the 2nd condition would be TRUE?

Click Here Before Posting Data or VBA Code --->How To Post Data or Code.

It actually should have read: IIf A2>30 color the row yellow or

If A2>15 and B2>60 color the row yellow or

If A2>5 and B2>62 color the row yellow otherwise leave the cell without formatting.With the B2> 60 for the second condition and the B2>62 for the third condition. I am comparing ages and years of service for retirement eligibility.

Ask Your Question

Weekly Poll

Do older people you know use the Internet?

Discuss in The Lounge

Poll History