简体   繁体   English

如何根据前一行的值将条件格式应用于整个列?

[英]How do I apply conditional formatting to an entire column based on the previous rows value?

I am trying to create a worksheet which colour codes the cells according to the next date.我正在尝试创建一个根据下一个日期对单元格进行颜色编码的工作表。 If the value of 1 July is higher than the value of 30 June then the cell of 1 July needs to be green but if its lower then it needs to be red.如果 7 月 1 日的值高于 6 月 30 日的值,则 7 月 1 日的单元格需要为绿色,但如果低于则需要为红色。 This would then apply to all dates in my worksheet according to the previous days value.然后,这将根据前几天的值应用于我的工作表中的所有日期。

I am unsure how to apply conditional formatting to an entire column based on the previous rows cell value and not one single cell value我不确定如何根据前一行单元格值而不是单个单元格值将条件格式应用于整个列

样本

The conditional formatting will be applied when the criteria result = TRUE.当条件结果 = TRUE 时,将应用条件格式。 Here is the formula to enter into the conditional format window to result in a RED cell.这是输入条件格式 window 以生成 RED 单元格的公式。 Green would be the same, but with a greater than symbol.绿色将是相同的,但具有大于符号。 Click on the first cell that should be conditionally formatted, then create the conditional format rule and check it.单击应该有条件格式化的第一个单元格,然后创建条件格式规则并检查它。 Then copy the cell, highlight the range of cells to be formatted and paste-formatting only.然后复制单元格,突出显示要格式化和粘贴格式的单元格范围。

Note, in your explanation you mention that a lower value than the prior day should be RED, but the image shows GREEN.请注意,在您的解释中,您提到比前一天低的值应该是红色,但图像显示为绿色。 You can reverse the formula below based on the output that you need.您可以根据您需要的 output 反转下面的公式。

=AND(ISNUMBER(B2),ISNUMBER(B3),B3<B2)

在此处输入图像描述

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

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