Stine.Can
Stine.Can

Reputation: 15

Is there a way to conditional format both row and column based on another cell?

I am trying to conditional format both row and column based on the data in C2.

For example, if C2=1 then I want Row 1 and Column G to be highlighted because G contains "X". I know how to conditional format for the horizontal data (=$B5=$C$2), but is there a way to highlight the vertical data?

Data

Upvotes: 0

Views: 220

Answers (1)

teylyn
teylyn

Reputation: 35915

Try this

enter image description here

Select cells C5 to U20 and then create a conditional format using this formula:

=OR($B5=$C$2,INDEX($C$5:$U$20,$C$2,COLUMN()-2)="x")

enter image description here

Upvotes: 2

Related Questions