将Google表格查询结果从一行分为两部分

时间:2019-06-13 03:46:21

标签: google-sheets transpose google-sheets-formula array-formulas google-sheets-query

我想获取我的QUERY结果并将一个单元格(H [说明])移到每个结果的下一行。

我发现this answer非常接近,但是表的格式不同,所以我不确定如何将其应用于我的场景。

这是基本概念:

    Category | Sub-Category | Item       | Description
    Fruit    | Citrus       | Orange     | It's orange
    Fruit    | Melon        | Cantaloupe | Round

进入

    Category | Sub-Category | Item  
    Fruit    | Citrus       | Orange     
    It's orange
    Fruit    | Melon        | Cantaloupe 
    Round

1 个答案:

答案 0 :(得分: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))

0