简体   繁体   English

具有文本,公式和条件格式的单元格。

[英]Cell with text, formula and conditional formatting.

I'm looking to see if you can add data to a cell, with a sum, and conditional formatting. 我想看看是否可以将数据加到单元格上,并求和并设置条件格式。 An example. 一个例子。

 <table style="width: 308px;"> <tbody> <tr> <td style="width: 122px;">A1</td> <td style="width: 105.233px;">A2</td> <td style="width: 200.767px;">&nbsp;</td> </tr> <tr> <td style="width: 122px;">100</td> <td style="width: 105.233px;">120 (+20)</td> <td style="width: 200.767px;">&nbsp;</td> </tr> </tbody> </table> <p>&nbsp;</p> 

I want cell A2 to show a new value (120) with the difference (+20) but also to have conditional formatting as in if the 120 in A2 is greater than the 100 in A1 then turn the cell green. 我希望单元格A2显示具有差值(+20)的新值(120),但也要有条件格式,就像A2中的120大于A1中的100一样,然后将单元格变为绿色。

One option is to do the difference in cell A3 then use the CONCATENATE formula but this adds in another column and I cannot establish how to run Conditional Formatting from that. 一种选择是在单元格A3中进行区别,然后使用CONCATENATE公式,但这又增加了另一列,而我无法确定如何从中运行条件格式。

Assuming A1 contains 100 (or any other number) and A2 120 (+20) (or anything of the style N (+/-N) where N is a string of numeric characters). 假设A1包含100 (或任何其他数字),而A2包含120 (+20) (或任何类型N (+/-N) ,其中N是一串数字字符)。

Please clear any existing conditional formatting, select A2 and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: : 请清除任何现有的条件格式,选择A2,然后选择HOME>样式-条件格式,新规则..., 使用公式确定要格式化的单元格,在此公式为true的情况下设置值的 格式 ::

=--LEFT(A2,FIND(" ",A2))>A1

Format... , select your green format OK , OK . 格式... ,选择绿色格式, 确定确定

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

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