简体   繁体   English

在一个单元格中使用百分比进行条件格式

[英]Conditional Formatting with percentage in one cell

I would like to create in excel condition formatting with percentage. 我想创建具有百分比的excel条件格式。

Here's what I have already (edited) 这是我已经(编辑)的内容

[ [ [ [ [ [ [ [ But I would like the separate my cell: 1) if value is less than cell value then background is green 1) if value is greaterthan cell value then background is red 但是我想分开我的单元格:1)如果值小于单元格值,则背景为绿色1)如果值大于单元格值,则背景为红色

OK, I'll start over. 好,我会重新开始。

in your screenshot, cell A7 does not have a value. 在您的屏幕快照中,单元格A7没有值。 therefore it is not greater than A1, therefore the green formatting rule is applied. 因此它不大于A1,因此应用了绿色格式化规则。

If you enter a value into cell A7, then that value can be used in the comparison of the conditional formatting rule. 如果您在单元格A7中输入一个值,则可以在条件格式设置规则的比较中使用该值。 If A1 has the value 56% and you enter 57% into A7, then A7 will turn red. 如果A1的值为56%,并且您在A7中输入了57%,则A7将变为红色。

在此处输入图片说明

If the value in cell A7 is less than 56% (and that includes the case where the cell is empty!!), then the green format will be applied. 如果单元格A7中的值小于56%(包括单元格为空的情况!),则将应用绿色格式。

在此处输入图片说明

If that is not what you want to achieve, then please edit your question and clarify. 如果这不是您想要实现的,请编辑您的问题并进行澄清。

Or do you want to set the color of A7 based on the value in A1, and if A1 is greater than something, then apply a format? 还是要基于A1中的值设置A7的颜色,并且如果A1大于某个值,则应用格式? In that case, please clarify what you want to compare the value in A1 WITH, because then we're back to the logic flaw in your original question. 在这种情况下,请阐明您要与A1 WITH中的值进行比较的原因,因为这样我们就回到了您原始问题中的逻辑缺陷。 You cannot use the value in A1 and compare whether it's greater or less than the value in A1. 您不能使用A1中的值来比较它是大于还是小于A1中的值。 That does not make sense. 那没有意义。

Based on this comment: 基于此评论:

I would like to have one cell with 2 color (eg 57% should be green and 43 % should be red) 我想要一个具有2种颜色的单元格(例如57%应该是绿色,而43%应该是红色)

...it sounds like you're looking for something quite different from the original question. ...听起来您正在寻找与原始问题完全不同的东西。 If you'd like your cell to have two colors, the proportion of which changes based on the value of the cell, you can use a databar and a set background. 如果您希望单元格有两种颜色,其颜色比例会根据单元格的值而变化,则可以使用数据栏和设置的背景。

Here, the background is red, and the databar is green. 在这里,背景为红色,数据栏为绿色。 The length of the databar changes based on the value of the cell. 数据栏的长度根据单元格的值而变化。

在此处输入图片说明

Is this what you're after? 这是你所追求的吗?

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

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