In Google Sheet Query, how to compute the value based on criteria of other cells?
Thanks.
Try the following
=QUERY({A2:D6},
"select Col1, Col2, sum(Col3), sum(Col4) where Col1 is not null
group by Col1, Col2
label sum(Col3) '', sum(Col4) '' ",0)
try:
=QUERY(QUERY(A1:D;
"select A,B,sum(C),max(D)
where A is not null
group by A,B");
"offset 1"; 0)