2

I'm trying to create a list of results from a QUERY where the result from column 1 acts as a "title" in column 1 and then the result from column 2 would be displayed on the following row, but still in the second column. And this would be the pattern for all results. I've attempted using the OFFSET function. I have also attempted OFFSET within QUERY but just can't seem to get what I'm looking for.

This is where I left off...

=ArrayFormula(SORT(IFERROR(VLOOKUP(F2:F,QUERY({J2:K},"SELECT Col1,Col2 WHERE Col1 matches '"&TEXTJOIN("|", 1, F2:F)&"'",0),{1,2},)),1,TRUE))

Ultimately, it would look like

Title
  Description
Title 2
  Description 2

Here is my sample sheet

player0
  • 124,011
  • 12
  • 67
  • 124
TC76
  • 860
  • 1
  • 8
  • 17
  • Hello, have you considered doing this with Apps Script? – Jescanellas Mar 30 '20 at 10:43
  • No @Jescanellas, I hadn't. I suppose I could and that would probably be easier, but I already have a lot of onEdit functions going on my sheet. I just assumed a formula would be faster. – TC76 Mar 31 '20 at 05:01

1 Answers1

3

try:

=ARRAYFORMULA(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(IFNA(
 VLOOKUP(SORT(F2:F), {J2:K4, "♦"&J2:J4, "♦♣ ♣"&K2:K4}, {3, 4}, 0)))
 ,,99^99)),,99^99), "♦")), "♣"))

0

player0
  • 124,011
  • 12
  • 67
  • 124
  • 1
    Thank you very much for this answer! The only other thing I was hoping for is that the second line be offset into column B. Much like you did [here](https://stackoverflow.com/questions/56573111/split-google-sheets-query-results-from-one-row-into-two) – TC76 Mar 31 '20 at 03:28