我有两个表,我必须根据连接条件计算值。可以用公式来做吗?
表格如下
表格1
RefT1 Value
A 7
B 2
C 5
D 4
表2RefT2 Value
B 5
D 8
E 7
我需要计算:The sum of values of items in both tables
The sum of the values in Table1 but not on Table2
The sum of the values in Table2 but not on Table1
我可以使用什么公式来实现这一目标?
最佳答案
你需要三个公式
两者(一个数组公式):
=SUM(SUMIF(A2:A5,D2:D4,B2:B5),SUMIF(D2:D4,A2:A5,E2:E4))
使用 Ctrl-Shift-Enter 输入
表格1:
=SUMPRODUCT(--(ISERROR(MATCH(A2:A5,D2:D4,0))),B2:B5)
表 2:反转列:
=SUMPRODUCT(--(ISERROR(MATCH(D2:D4,A2:A5,0))),E2:E4)
关于Excel公式计算表之间的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42936334/