Home > Back-end >  Display results from filter formula in one row?
Display results from filter formula in one row?

Time:07-16

I am using a filter formula to output multiple results based on a condition. Each result contains 4 columns of data, each result is in a new row. However, I would like all results to be output one after the other (i.e. in one row). The data of each result takes up 4 columns and in the fifth column, the new result starts with 4 columns.

This is how it looks now: Current status

This is how it should look: Goal

CodePudding user response:

To get this dynamically, follow these steps.

1 - in the sheet where you want the results on cell A2 past this formula.

=TRANSPOSE(FLATTEN(QUERY(Data!A2:D," Select * where A is not null ")))
  • enter image description here

    Output example:
    enter image description here

    CodePudding user response:

    You first need to use Flatten() to make it a one dimensional array since the spreadsheet data is in a nested array no matter how many rows/columns you have.

    enter image description here

    Then from here you can just transpose the data so instead of the data going down the rows it will be transposed to go horizontally to the columns.

    Try:

    =TRANSPOSE(FLATTEN(A2:D))
    

    To combine it with your formula just replace the Range "A2:D" with your current formula.

    Result: enter image description here

    References:

  • Related