How to use SUMIFS function for summing values if c

2019-08-22 16:09发布

My data:

A   B    C
a   3    d
b   1    a
c   8    e
d   5    

I want to use SUMIFS function, sum range is B1:B4, if the corresponding value in column A exists in column C, sum the values in column B, in this case the sum will be 3 + 5 = 8 I tried =SUMIFS(B1:B4,A1:A4, COUNTIF($C$1:$C$3,A1) but I get zero.

标签: excel sumifs
2条回答
贪生不怕死
2楼-- · 2019-08-22 17:05

What you want is this:

=SUMIFS(B1:B4,A1:A4,A1)

Edit:

I know you asked for a sumif, but that doesn't want to work, entering the below as an array formula (CTRL+SHIFT+ENTER) does the trick.

=SUMPRODUCT(B1:B4,(IFERROR(MATCH(A1:A4,C1:C4,0),0)>0)*1)
查看更多
地球回转人心会变
3楼-- · 2019-08-22 17:10
=SUMPRODUCT(SUMIF(A1:A4,C1:C3,B1:B4))

Link for further reading: COUNTIFS: Multiple “OR” Criteria For One Or Two Criteria_Ranges

查看更多
登录 后发表回答