Excel - SUMIFS for multiple columns

房东的猫 提交于 2021-01-24 08:27:08

问题


I need to sum the values of several columns, if other cells in the same row match a predefined criteria. The working formula for only 3 columns is the following:

=SUM(SUMIFS(‘Sheet1'!W:W; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!X:X; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!Y:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4"))

I will need to use the formula for several cells (and sum more than 10 columns per time) and I will need to change the columns manually, so I need the same formula in the following way:

=SUMIFS(‘Sheet1'!W:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4")

,but currently this formula leads to a "#VALUE!" error. The reason for that is (I assume) the use of multiple columns "W:Y" Can you suggest a workaround?


回答1:


I would suggest to use SUMPRODUCT rather than SUMIFS. You can build something like that :

=SUMPRODUCT((B1:B1048575="Sales")*(C1:C1048575>=4)*(W1:Y1048575))

The downside of SUMPRODUCT is that you can't use a whole column (for example you cannot write SUMPRODUCT((B:B="Sales"...)), this would generate an error).

Hope this helps.




回答2:


I suggest you add a column with the sum('sheet1'!W:Y) and then use sumifs on this columns. It is a two step way but it will give the result you expect




回答3:


Here's what I have :)

=SUM(SUMIFS('WTD Raw'!R:R,'WTD Raw'!E:E,"Kindle-Customer Care",'WTD 
      Raw'!J:J,"Week27",'WTD Raw'!H:H,'PassRate | July'!G8) + SUMIFS('WTD 
      Raw'!R:R,'WTD 
      Raw'!E:E,"Kindle-Technical Support",'WTD Raw'!J:J,"Week27",'WTD 
      Raw'!H:H,'PassRate | July'!G8))

Instead of using ";" use the Mathematical Operators for it to work.



来源:https://stackoverflow.com/questions/36568470/excel-sumifs-for-multiple-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!