假设我有这样的产品类别查找:
Sheet 1
Product Name | Product Category
--------------------------------------
product 1 | A
product 2 | A
product 3 | B
product 4 | A
product 5 | B
product 6 | C
而且我还有一个仅使用产品名称的购买清单,如下所示:
Sheet 2
Product Name | Purchase Quantity
---------------------------------------
product 1 | 35
product 4 | 10
product 5 | 5
我想生成这样的汇总:
Product Category | Purchase Quantity
------------------------------------------
A | 45
B | 5
C | 0
我尝试了多种方法来解决这个问题,例如:
SUMIF(LOOKUP('Sheet 2'!A2:A6,'Sheet 1'!A:A,'Sheet 2'!B:B), "=A", 'Sheet 2'!B2:B6)
SUMPRODUCT(LOOKUP('Sheet 2'!A2:A6, 'Sheet 1'!A:A, 'Sheet 2'!B:B)="A"*'Sheet 2'!B2:B6)
Excel不喜欢第一个。它说公式不正确,但我不明白为什么。第二个产生#VALUE。对此的任何帮助将不胜感激。提前致谢!