【问题标题】:Excel - formula for If/Then conditions with negative numbersExcel - 带有负数的 If/Then 条件的公式
【发布时间】:2021-07-13 16:19:29
【问题描述】:

我正在处理一个文件,该文件将衡量测试结果并确定所需知识能力与当前知识能力之间的差距。我有 5-6 种能力来衡量每个人。最低差距为 -4,最高差距为 4。

Conditions (IF) Rating (THEN)
All gaps have negative values Does not meet requirements
Has 1-2 negative values but with 1-2 zero gaps Meets some requirements
All gaps are zero Meets all requirements
1-2 gaps are positive, can have zero Exceeds some requirements
All gaps are positive and have no zero Exceeds all requirements

例如,

Subjects Gaps Remarks
Competency 1 2 2 pts higher than expected
Competency 2 -1 Less than expected
Competency 3 -1 Less than expected
Competency 4 -1 Less than expected
Competency 5 0 expected
Competency 6 1 1 pt higher than expected
Total Rating Meets some requirements

我已尝试逐步剖析并合并索引/匹配/模式公式,但我似乎无法使其发挥作用。我真的需要一些帮助!提前谢谢!

【问题讨论】:

  • 嗨! @BigBen 我编辑了上面的问题。希望它提供清晰!

标签: excel if-statement excel-formula


【解决方案1】:

假设差距在B2:B7,我相信这符合你的逻辑:

=IF(COUNTIF(B2:B7,">=0")=0,"Does not meet",
 IF(COUNTIF(B2:B7,0)=COUNT(B2:B7),"Meets all",
 IF(COUNTIF(B2:B7,">0")=COUNT(B2:B7),"Exceeds all",
 IF(COUNTIF(B2:B7,"<0")>0,"Meets some",
 "Exceeds some"))))
 &" requirements"

【讨论】:

  • 哇,真快!!只是想澄清一下,最后这句话是什么意思? IF(COUNTIF(B2:B7,"0,"满足一些", "超过一些"))))&"要求"
  • 检查是否有一些空白是负数。如果不是,那么一些差距是积极的。该公式之前已检查所有间隙或负数或所有间隙为正数或全部为零...所以最后一次检查是针对一些个间隙。
  • 非常感谢您!自上周五以来一直试图解决这个问题:)
  • 嗨大本!只是澄清一下,该公式似乎没有识别负值,因为它总是返回“不符合”。上面示例中所写的负值也具有识别“间隙”的公式。我不确定为什么当负值有公式时这不起作用,而如果按原样写入负值,公式正在工作。
  • 删除公式中 -11 周围的引号。 "-1""1" 是文本,而不是数字。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多