简体   繁体   English

excel中有没有办法对整列应用基于公式的条件格式?

[英]Is there a way in excel to apply a formula based conditional format for an entire column?

So I have these columns:所以我有这些列: 在此处输入图片说明

And what I would like to have each cell under the "Completed Date" column change color according to whether the date is before or after the due date or if it's blank.我希望“完成日期”列下的每个单元格根据日期是在截止日期之前还是之后或者是否为空白来改变颜色。 I'd like to do it in a way where I don't have to set the conditions for each cell individually but rather in a sort of "drag through" way, like when you use a formula, and you drag that formula down, it applies to each adjacent cell on the way down.我想以一种不必为每个单元格单独设置条件而是以一种“拖动”方式来完成它,例如当您使用公式时,然后将该公式向下拖动,它适用于下降过程中的每个相邻单元格。 Any assistance with this would be most appreciated.对此的任何帮助将不胜感激。 Thanks!!谢谢!!

As @cybernetic.nomad says, get it right for the top-left cell and the rest will follow.正如@cybernetic.nomad 所说,为左上角的单元格设置正确,其余的将随之而来。 For example, if you want to highlight where the completion date is after the due date, put例如,如果要突出显示完成日期在截止日期之后的位置,请输入

=AND(ISODD(COLUMN()),B2>A2)

as a custom formula.作为自定义公式。

在此处输入图片说明

You will need separate rules to highlight blanks and completion dates equal to or before before the due date.您将需要单独的规则来突出显示空白和等于或早于截止日期的完成日期。

What happens if your range starts in column A, so there is no column before it?如果您的范围从 A 列开始,因此在它之前没有列会发生什么? A strange quirk of conditional formatting is that it allows you to wrap it around to the very last column (XFD), so in this case your formula would look like this:条件格式的一个奇怪之处在于它允许您将其环绕到最后一列 (XFD),因此在这种情况下,您的公式将如下所示:

=AND(ISEVEN(COLUMN()),A2>XFD2)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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