Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 Excel 的 sumifs 在行和列上使用条件来查找矩阵元素的总和?例如矩阵:
c d e a 1 2 3 b 4 5 6
我想对 b 行、d 和 e 列的元素求和。该解决方案也适用于大维矩阵。抱歉,格式很丑。
也许这个公式可以扩展到您的需要:(A1:D3中的数据)
=SUMPRODUCT(--ISNUMBER(MATCH(B1:D1,{"d","e"},0)*MATCH(A2:A3,{"b"},0)),B2:D3)
沿着类似的思路,您可以尝试:
=SUM(((B1:D1="d")+(B1:D1="e"))*(A2:A3="b")*B2:D3)
它使用关于算术运算的想法,TRUE 为 1,FALSE 为 0。