How to sum a range based on another range which comes under another range in sheets

可紊 提交于 2019-12-11 18:06:42

问题


I wanted to know how can we sum a range in a sheet based on another range which comes under another range.

Example: I want the sum of A2:A10 if corresponding cell B1:B10 value comes under a list which is D2:D or E2:E

in Example,

Sum of Fruits:    ? 
Sum of Vegetable: ?


回答1:


=DSUM({"x", "y"; A2:B}, "x", {"y"; FILTER(E2:E, E2:E<>"")})

=DSUM({"x", "y"; A2:B}, "x", {"y"; FILTER(D2:D, D2:D<>"")})


EU syntax:

  • =DSUM({"x"; "y"\ A2:B}; "x"; {"y"\ FILTER(E2:E; E2:E<>"")})
  • =DSUM({"x"; "y"\ A2:B}; "x"; {"y"\ FILTER(D2:D; D2:D<>"")})


来源:https://stackoverflow.com/questions/54549856/how-to-sum-a-range-based-on-another-range-which-comes-under-another-range-in-she

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