添加唯一值并排除常数

时间:2018-12-03 22:05:31

标签: excel countif

我需要添加唯一值,并确保排除常数(例如10)

Acct #        Value
9xxx123        50
9xxx123        50
9xxx123        10
9xxx123        15
9xxx234        10
9xxx234        25
9xxx234        25
9xxx234        30

答案应为:9xxx123 = 65,对于9xxx234 = 55

在另一个线程上,有人已经建议使用以下命令:

=SUMPRODUCT((($A$2:$A$9=E2)*$B$2:$B$9)/(COUNTIFS($A$2:$A$9,E2,$B$2:$B$9,$B$2:$B$9)+($A$2:$A$9<>E2))) 

但是现在我需要排除常数值。

谢谢!

狮子座

1 个答案:

答案 0 :(得分:0)

要将跳过10添加到现有内容:

=SUMPRODUCT((($A$2:$A$9=E2)*($B$2:$B$9<>10)*$B$2:$B$9)/(COUNTIFS($A$2:$A$9,E2,$B$2:$B$9,$B$2:$B$9,$B$2:$B$9,"<>" & 10)+($A$2:$A$9<>E2)+($B$2:$B$9 = 10)))

enter image description here