问题
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