如何对一行求和?

问题描述 投票:0回答:1

我的桌子是这样的

Month     January    February
Apple       50           50
Orange      10           10
Grapes      5             5

当我尝试像

sumif Apple
那样
=sumif(A2:A4,"Apple",B2:C4)
时,它只给我一月份的50,而不是整条线。我需要的答案是 100。

我该如何编辑公式?

excel excel-formula sumifs
1个回答
1
投票

使用

SUMPRODUCT
代替:
=SUMPRODUCT((A2:A4="Apple")*B2:C4)

© www.soinside.com 2019 - 2024. All rights reserved.