简体   繁体   中英

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?

数据

Try this

在此处输入图片说明

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")

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM