TC76
TC76

Reputation: 860

Offset column 2 of query results by one row

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

Upvotes: 2

Views: 885

Answers (1)

player0
player0

Reputation: 1

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

Upvotes: 3

Related Questions