简体   繁体   中英

Conditional Formatting based on Excel Table header

I want to highlight the cells in the month columns (CF) if the dates in column A and B are in these month. The conditional formatting is working fine as you can see in the picture. But the formula in the conditional formatting refers to the dates in row 1. If I refer on the table headers, it stops working. The format of the table headers is DATE.

=AND(C$1>=$A3;C$1<$B3) is working, which refers on cells in row 1 outside the table

=AND(C$2>=$A3;C$2<$B3) isn't working, refering on the table headers in row 2

=AND("Table1[@Headers]">=$A3;"Table1[@Headers]"<$B3) also not working with structured references to the table headers

Is my structured reference wrong?

在此处输入图像描述

You can't use table references in CF, but you can refer to sheet ranges as usual. In CF use formula:

=AND(DATEVALUE(C$1)>=$A2;DATEVALUE(C$1)<$B2)

在此处输入图像描述

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