单元格值的条件格式设置规则 - 绝对值

时间:2015-07-24 10:41:53

标签: excel

我正在使用Excel 2013。

我在单元格上使用条件格式。我使用功能区上的突出显示单元格规则选项添加了3条规则。

我的手机包含一个公式。在另一个单元格中是一个容差级别的值,让我们调用此值。

我当前的条件格式如下所示,工作正常,

If my cell is less than tol * 0.8 then colour it green
If my cell is between tol * 0.8 & tol * 0.9 then colour it yellow
If my cell is greater than tol * 0.9 then colour it red

然而,我的细胞值可能是负的,我只关心细胞的绝对值。如果否定我的规则会将其颜色设置为绿色,这可能不正确,请参阅下面的一个简单示例。

My Cell        Tolerance Level       Outcome I want     My Current Result
75             100                   Green              Green
85             100                   Yellow             Yellow
95             100                   Red                Red
-75            100                   Green              Green
-85            100                   Yellow             Green
-95            100                   Red                Green

修改

我不能让我的格子值绝对。需要查看其否定的时间

2 个答案:

答案 0 :(得分:1)

只需添加与负值相同的格式

 If my cell is between tol * -0.79 & tol * 0.79 then colour it green
 If my cell is between tol * 0.8 & tol * 0.9 then colour it yellow
 If my cell is greater than tol * 0.9 then colour it red

 If my cell is between tol * -0.8 & tol * -0.9 then colour it yellow
 If my cell is less than tol * -0.9 then colour it red

答案 1 :(得分:1)

根据公式创建三个规则;每个都使用ABS function

=ABS(cell/tol)<0.8                            'for green
=AND(ABS(cell/tol)>=0.8, ABS(cell/tol)<=0.9)  'for yellow
=ABS(cell/tol)>0.9                            'for red

示例:

=ABS($A2/$B2)<0.8
=AND(ABS($A2/$B2)>=0.8, ABS($A2/$B2)<=0.9)
=ABS($A2/$B2)>0.9

Tolerance Level

相关问题