我有一个平均的回归表达式:
SELECT DISTINCT messages_id
FROM messages_categories r1
WHERE NOT EXISTS
(SELECT *
FROM
(SELECT 1 as cat_id UNION SELECT 2 ) S -- id of categories needed
WHERE NOT EXISTS
(SELECT *
FROM messages_categories AS r2
WHERE (r1.messages_id = r2.messages_id)
AND (r2.category_id = S.cat_id)));
由于如果任何元素为零,它返回错误的值,我希望通过将 =AVERAGE((C6*D6);(E6*F6);(G6*H6);(I6*J6);(K6*L6);(M6*N6);(O6*P6);(Q6*R6);(S6*T6);(U6*V6))
替换为 AVERAGE
功能:
AVERAGEIF
但是,Excel不接受此公式。公式出了什么问题?
我也尝试过针对非连续范围建议的解决方案:https://colinlegg.wordpress.com/2013/05/04/conditional-average-on-non-contiguous-ranges-using-frequency/但没有成功。
=AVERAGEIF(((C6*D6);(E6*F6);(G6*H6);(I6*J6);(K6*L6);(M6*N6);(O6*P6);(Q6*R6);(S6*T6);(U6*V6));"<>0")
我得到#VALUE!错误。