Search code examples
google-sheetsfiltertransposeflattengoogle-query-language

Ignore blank cells after using Filter in Google Sheets


My Table looks like this enter image description here

This is a result of using =filter('Form Responses 1'!A:BJ,'Form Responses 1'!F:F=subjects!A19)

Now all I have to do is, ignore the blank cells and put in the last 3 columns.

I mean, columns N,O,P should come to H,I,J and similiarly other columns towards right of column G should come to columns to H,I,J.

Please help


Solution

  • use:

    =FILTER({'Form Responses 1'!A:G, 
     TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(
     IF('Form Responses 1'!H:BJ="",,'Form Responses 1'!H:BJ&"♥")),,9^9)), "♥"))}, 
     'Form Responses 1'!F:F=subjects!A19)