简体   繁体   English

Excel-基于以前的单元格值更改颜色的单元格

[英]Excel - Cells to change color based on previous cell value

I am trying to create a formula in Excel whereby a cell would change color based on the value in the previous cell. 我正在尝试在Excel中创建一个公式,其中一个单元格将根据前一个单元格中的值更改颜色。

for example if cell B2 contains value X and then B3 contains value Y, I would like B3 to turn green if B3> B2 else to turn red. 例如,如果单元格B2包含值X,然后B3包含值Y,则我希望B3变为绿色,如果B3> B2则变为红色。

'Standard' fill red the relevant range and select Column B, clear any existing CF rules and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: : “标准”用红色填充相关范围,然后选择列B,清除所有现有的CF规则,然后清除“ HOME”>“样式-条件格式,新规则...”, 使用公式确定要格式化的单元格,在此公式为true的情况下格式化值:

=AND(B1>B1048576,ROW()<>1)

Format... , select green fill, OK , OK . 格式... ,选择绿色填充, 确定确定

I am assuming your column is labelled. 我假设您的专栏已贴上标签。

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

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