[英]excel: How do I combine probabilities with “or”?
I have a range B2:F2
which contains probabilities of different events, eg, 我有一个范围
B2:F2
,其中包含不同事件的概率,例如,
0.9 0.7 0.1 0 0.3
The probability of the "and" event is he product of the probabilities (assuming independence) and can be computed using product(b2:f2)
. “和”事件的概率是概率的乘积(假设独立性),可以使用
product(b2:f2)
进行计算。
The probability of the "or" event is 1-product(1-(b2:f2))
but that results in the #VALUE!
“或”事件的概率为
1-product(1-(b2:f2))
但结果为#VALUE!
. 。
So, do I really need to resort to typing 1-(1-b2)*(1-c2)...
explicitly? 因此,我是否真的需要求助于明确键入
1-(1-b2)*(1-c2)...
?
You're almost there - type the formula you have already ( =1-product(1-B2:F2)
) then press Ctrl+Shift+Enter (instead of Enter) to make it an array formula. 您快到了-键入您已经拥有的公式(
=1-product(1-B2:F2)
),然后按Ctrl + Shift + Enter(而不是Enter)以使其成为数组公式。
In this case the result itself is not an array, but the application of the array formula modifies the behaviour of the subtraction operator for 1-B2:F2
to apply the operation to each element of the input range. 在这种情况下,结果本身不是数组,但是数组公式的应用会修改
1-B2:F2
的减法运算符的行为,以将运算应用于输入范围的每个元素。
Your Product function works but it's an "array formula" that needs to be confirmed with CTRL + SHIFT + ENTER so that curly braces like { and } appear around the formula in the formula bar 您的Product函数可以工作,但是它是一个“数组公式”,需要通过CTRL + SHIFT + ENTER进行确认,以便{和}之类的花括号出现在公式栏中的公式周围
=1-PRODUCT(1-B2:F2)
....or alternatively you can add an INDEX
function which means it can be normally entered, ie ....或者您可以添加一个
INDEX
函数,这意味着可以正常输入它,即
=1-PRODUCT(INDEX(1-B2:F2,0))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.