【发布时间】:2018-04-23 16:11:48
【问题描述】:
在 Excel 中排名时有没有办法将负数视为零?
我有以下内容,但如果我有多个零或负数,我最终会得到重复的排名,这是我不能拥有的。我最终得到:
1 2 3 4 5 6 7 8 8 8 9 10 11 12 13 14 15 16 ... 55
但我需要
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ... 55
=IF($S79<0,RANK(0,$S$68:$S$121,0)+COUNTIF($S$68:$S79,0)-1,RANK($S79,$S$68:$S$121,0)+COUNTIF($S$68:$S79,$S79)-1)
编辑澄清:
目前我有 55 行。第 1-20 行通常为正数,其余为 0。当我有一个负数时,它不会被放在第 21 位(在所有正数下方),而是放在第 55 位(因为它小于零)。
所以不是
1 - 43%
2 - 35%
3 - 22%
4 - 0%
5 - 0%
6 - -20%
我来了
1 - 43%
2 - 35%
3 - 22%
4 - 0%
5 - 0%
6 - 0% (treating the negative as zero, but visually still displaying the negative number)
它用于加权百分比排行榜。我找到了一种解决方法,只需添加对百分比的检查,类似于“如果 %
我得到了:
1. Person 1 - 100%
2. Person 2 - 90%
3. Person 3 - 90%
4. Person 4 - 0%
5. Empty Slot - 0%
6. Empty Slot - 0%
7. Empty Slot - 0%
8. Person 5 - -50%
我想要:
1. Person 1 - 100%
2. Person 2 - 90%
3. Person 3 - 90%
4. Person 4 - 0%
5. Person 5 - -50%
6. Empty Slot - 0%
7. Empty Slot - 0%
8. Empty Slot - 0%
已解决(通过在生成 % 的位置添加检查):
1. Person 1 - 100%
2. Person 2 - 90%
3. Person 3 - 90%
4. Person 4 - 0%
5. Person 5 - 0%
6. Empty Slot - 0%
7. Empty Slot - 0%
8. Empty Slot - 0%
【问题讨论】:
-
首先您说要将所有负数视为0,然后您说不能有重复条目?如果负数被视为 0,您将有重复的条目。请说明你想要什么。
-
已更新帖子以进行澄清。
-
查看编辑。评论太长了..
标签: excel excel-formula ranking rank