问题
I want to take my QUERY
results and move one cell (H [description]) to the following row of each result.
I found this answer, which is very close, but the format of the table is different, so I'm not sure how to apply it to my scenario.
This is the basic idea:
Category | Sub-Category | Item | Description
Fruit | Citrus | Orange | It's orange
Fruit | Melon | Cantaloupe | Round
Into
Category | Sub-Category | Item
Fruit | Citrus | Orange
It's orange
Fruit | Melon | Cantaloupe
Round
回答1:
=ARRAYFORMULA(QUERY(SUBSTITUTE(TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(
QUERY(TRANSPOSE(IF(IFERROR(SPLIT(C1:C, ";"))<>"", "♥"&A1:A&"♦"&B1:B&"♦"&
IFERROR(SPLIT(C1:C, ";"))&"♥"&D1:D, )),,999^99)),,999^99), "♥")), "♦")), D1, ),
"where Col1 is not null", 0))
=ARRAYFORMULA(QUERY(SUBSTITUTE(TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(
QUERY(TRANSPOSE(IF(C1:C<>"", "♥"&A1:A&"♦"&B1:B&"♦"&C1:C&"♥ ♦"&D1:D, ))
,,999^99)),,999^99), "♥")), "♦")), D1, ),
"where Col2 is not Null", 0))
来源:https://stackoverflow.com/questions/56573111/split-google-sheets-query-results-from-one-row-into-two