JohnK
JohnK

Reputation: 33

Multi-function conditional formatting cell range

I want to give a quick indication using coloured cells of the time likely to be taken to complete a task. So for example:

if cell B2 = 1 then fill cell range G2:H2 with light red
if cell B2 = 2 then fill cell range G2:J2 with light red
if cell B2 = 3 then fill cell range G2:L2 with light red

How might I achieve this?

Upvotes: 3

Views: 172

Answers (2)

chancea
chancea

Reputation: 5968

If you want a dynamic formula and only one format setting you can select all the cells you want to format, then make a new conditional formatting rule using the formula:

=$B$2*2+COLUMN($G:$G)-COLUMN()>0

Which will affect 2 additional cells each time you increment $B$2. I used your examples of $B$2 and starting with $G:$G but you can change those if needed.

If you need multiple format settings this won't work.

Upvotes: 1

pnuts
pnuts

Reputation: 59485

Select G2:H2 and use a CF formula rule of:

=$B$2=1  

Select G2:J2 and use a CF formula rule of:

=$B$2=2  

Select G2:L2 and use a CF formula rule of:

=$B$2=3  

each with the formatting of your choice.

Upvotes: 1

Related Questions