Want to get the results described on the screenshot. How can I achieve it.
QUERY:
=QUERY(A2:F12,"SELECT A, MAX(B), MIN(B) group by A label A 'G V1', MAX(B) 'LAST V2', MIN(B) 'FIRST V2'")
Want to get First & last V5 value in terms of max and min dates in V2 (see K2, L2 desired results), I could get the last and first dates now I want their V5 corresponding.
Best Answer
I'm not sure if this will work for the entire end goal, but, based on the observation that every column is the result of a query returning one row, is it possible that you may be able to have one simple query per column, each returning one row. For example:
The formula for columns:
E1
:=query(Sheet1!$A$2:$A$8, "select max(A) group by A")
F1
:=query(Sheet1!$A$2:$B$8, "select max(B) group by A")
G1
:=query(Sheet1!$A$2:$C$8, "select min(B) group by A")
H1
:=query(Sheet1!$A$2:$C$8, "select max(C) group by A")
I1
:=query(Sheet1!$A$2:$C$8, "select min(C) group by A")
Notes:
Sheet1
, that's just there in case the data is on a different sheet (tab). Of course change it or remove it (and the trailing!
) if the sheet isn't calledSheet1
.$A$2:$C$8
in each query.