I would like to create a summary sheet that draws from arrays in two work sheets. I would like the summary sheet (Result) contains two filtered arrays, one below the other (see the attached
CodePudding user response:
You can stack the data with {} in googlesheet as long as they have the same array-length.
- the filters are named as
FILTER1
andFILTER2
withLAMBDA()
, - added a title line to both filter with
QUERY()
, - get the 1st row of
FILTER1
byINDEX()
, - get the length of a row of data by
COUNTA()
, - set an array with specified rows and cols by
MAKEARRAY
and name itEMPTYROW
, - stack the data created above with
{}
and;
.
=LAMBDA(FILTER1,FILTER2,
LAMBDA(ROWLEN,
LAMBDA(EMPTYROW,
{
FILTER1;
EMPTYROW;
FILTER2
}
)(MAKEARRAY(1,ROWLEN,LAMBDA(ROW,COL,"")))
)(COUNTA(INDEX(FILTER1,1,)))
)(
QUERY(filter('Sheet 1'!A3:D25,'Sheet 1'!D3:D25=TRUE),
"LABEL Col1'SHEET 1',Col2'',Col3'',Col4''"
),
QUERY(filter('Sheet 2'!A3:D25,'Sheet 2'!D3:D25=TRUE),
"LABEL Col1'SHEET 2',Col2'',Col3'',Col4''"
)
)