Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to color a cell in Excel 2007 based on a statement like, if B6=H and C6=g then color A6 Blue

I have no idea what the proper script would be but here is my guess that does not work: =IF(AND(B6=$H$, C6=$g$),"MAKE A6 Blue")

I am trying to do contitional formatting. Could someone please get me on track?

share|improve this question
add comment

1 Answer

Yes, you're on the right track. You want a formula like:

=AND($B$6="H",$C$6="g")

You would add this as a Conditional format (Home tab in the Styles section) on A6. Select New Rule... and then "Use a formula to determine which cells to format". You use the above formula for the condition and then use the Format section to Fill the cell as you require.

You can modify the formula further to make it more generic or to make it work on other cells in the same row/column.

share|improve this answer
    
Your suggestion will make the cell True or False, which is good, but I need it to color the field not plug in True or False. Any suggestions on adding a color fill to the script? –  LtDan Apr 19 '11 at 12:55
    
Updated to make it clearer, I hope. You don't put the formula in the cell, you put it in the conditional format. –  Rhys Gibson Apr 19 '11 at 20:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.