Home > Software engineering >  Leave Rows before Outputting Array Results
Leave Rows before Outputting Array Results

Time:11-29

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 enter image description here

CodePudding user response:

You can stack the data with {} in googlesheet as long as they have the same array-length.

  1. the filters are named as FILTER1 and FILTER2 with LAMBDA(),
  2. added a title line to both filter with QUERY(),
  3. get the 1st row of FILTER1 by INDEX(),
  4. get the length of a row of data by COUNTA(),
  5. set an array with specified rows and cols by MAKEARRAY and name it EMPTYROW,
  6. stack the data created above with {} and ;.

result

=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''"
 )
)
  • Related