简体   繁体   中英

(Excel) Is there a way to conditional format a cell from a range of cells based on the value of an another cell?

I have a cell with a text, which is the place of an another cell that I want to highlight. Lets say that it is the F6 cell, and in it, it says 'C6'. Is there a way to use conditional formatting to highlight the 'C6' cell ? Any other cell can be inputted into the F6 cell and the formatting will highlight it, if it is in the Data range.

示例图片

You could compare the address of the current cell to the contents of F6, either:

=ADDRESS(ROW(),COLUMN(),4)=$F$6

or

=SUBSTITUTE(CELL("address",B4),"$","")=$F$6

在此处输入图片说明

If you are happy to write $C$6 you could use CELL()

Define conditional formating on B4:D7 as =CELL("address",B4)=$F$6 =CELL("address",B4) will return the reference of that cell in the from of $COLUMN$ROW (eg $C$6 for the cell C6 ) and that you can then compare.

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