简体   繁体   English

基于先前单元格值的条件格式

[英]Conditional Formatting based on previous cell value

I'm looking to apply Conditional Formatting to a range of data I have in Excel that will display red if the most recent day of data is below what it was before, and green if it was higher. 我希望将条件格式应用于Excel中的一系列数据,如果最近一天的数据低于以前的数据,则显示红色,如果更高,则显示绿色。

Eg Day,Value, Highlight cell colour 例如,天,值,突出显示单元格颜色

  • Day 1 1000 第一天1000
  • Day 2 2000 Green - as it's higher than day 1 2000年第2天绿色-因为比第1天高
  • Day 3 500 Red - as it's lower than day 2 第3 500天红色-比第2天还低
  • Day 4 6000 Green 第四天6000绿色
  • Day 5 4000 Red 第五天4000红色

I want to replicate this for all my data and then ideally be able to count the number of 'runs there are' eg number of red cells together so you can see the number of consecutive days that performance has fallen by. 我想对所有数据进行复制,然后理想地能够计算“运行次数”(例如,红细胞数量)在一起,以便您可以看到性能下降的连续天数。

What formula do I use to achieve both things? 我要用什么公式来实现这两个目标?

This is for Excel 2007 (hopefully you can adapt as necessary): 这是针对Excel 2007(希望您可以根据需要进行调整):

SO17419835示例

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

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