更新时间:2022-10-30 23:06:42
对条件格式使用自定义函数。例如,如果您描述的列在第2行中,则该函数将针对> = A2
和< = B2
:
= AND(C2> = $ A2,C2
选择您希望为其创建条件格式的单元格范围; C2..L2
,比方说。打开条件格式对话框,然后选择自定义公式。输入上面的公式;请注意,itr是指您希望将公式应用于该公式的范围的左上角 - 表格会自动调整该范围的剩余部分,这就是为前两列使用绝对引用非常重要的原因。
I've tried the conditional format, using the "between" values. It doesn't work.
If I just type the numbers into the format box, it will work, but the problem is I need it to refer to the value in the cell NOT a number I type in, because there is a likelihood that the dates could change, which will affect the value shown in week number cell, so I need it to work automatically and not require me to go through every single row changing values for the formatting.
Is this even possible on sheets?
Thanks in advance, I am hoping I've just overlooked something simple.
Use a custom function for conditional formatting. For instance, if the columns you describe are in Row 2, this function will evaluate "TRUE" for numbers that are >= A2
and <= B2
:
=AND(C2>=$A2,C2<=$B2)
Select the range of cells you wish to create a conditional format for; C2..L2
, say. Open the conditional formatting dialog, and choose "Custom formula". Enter the formula above; note that itr refers to the top-left corner of the range you wish to apply the formula to - Sheets will automatically adjust it for the rest of the range, which is why it's important to use absolute references for the first two columns.