Color fill based on multiple conditions

C

C

My spreadsheet contains subtotals.

A B C D E F
Production Line 1 10 1 5 2 10
Production Line 1 10 1 5 2 10
Production Line 1 Total 20 2 10 4 20

Some months the spreadsheet contains 100 lines and some months it contains
200. Does someone have some code that would loop through all the data in the
sheet and for each subtotaled line (when A contains Total), go to the same
row for B:F and if value is
less than 5, fill with orange
between 6 and 15, fill with blue
greater than 15, fill with green

I am using Excel 2003.

Blue Angel
 
B

Bernard Liengme

In A2:A10 I entered some text; a few had the word "Total"
In B2:F10 I entered some numbers
I select B2:F10 and in the Conditional Formatting dialog used
Formula IS: =AND($A2="Total", B2<5)
Format fill orange
Note the $ on A2. Because I selected down to row 10, the conditional
formatting applies to those rows also (so row 5 is =AND($A5="Total", B5<5) )
In pre-Excel2007 you can have up to 3 conditions
For more on the topic go to
See http://www.contextures.com/xlCondFormat01.html

best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top