SUMPRODUCT vs SUMIFS

后端 未结 4 531
情话喂你
情话喂你 2020-12-31 09:21

I\'m trying to make an in-company guide to Excel (we\'re a small non-profit and sorely need some sort of baseline guide). However, I\'ve gotten stuck trying to explain the d

4条回答
  •  臣服心动
    2020-12-31 09:36

    SUMPRODUCT can be used more flexibly than SUMIFS because you can modify the ranges with other functions in SUMPRODUCT, e.g. if you have a range of dates in A2:A100 how can you sum the corresponding amounts in B2:B100 for December dates (in any year)?

    You can use this formula to get the answer

    =SUMPRODUCT((MONTH(A2:A100)=12)+0,B2:B100)

    You can't do that easily with SUMIFS, although if the dates are all in one year you can just use the start and end points of the range as the criterion in SUMIFS, e.g. for December 2014 only:

    =SUMIFS(B2:B100,A2:A100,">="&DATE(2014,12,1),A2:A100,"<"&DATE(2015,1,1))

    SUMPRODUCT can also be used to reference data in closed workbooks, SUMIFS can't do that - see here

    http://support.microsoft.com/kb/260415

    ...but in general SUMIFS is significantly quicker, I've seen a 5x figure quoted but I haven't verified that.

    For multiple interesting uses of SUMPRODUCT see this article by MS Excel MVP Bob Philips

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

提交回复
热议问题