简体   繁体   中英

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.

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.

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).

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: :

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

Format... , select your green format OK , OK .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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