【问题标题】:How can I combine multiple columns into one column in Google Sheets?如何在 Google 表格中将多列合并为一列?
【发布时间】:2021-08-03 07:40:35
【问题描述】:

(注意:请查看 Google 表格,以最快速度了解我在以下要点中所描述的内容)

  • 我的数据有一行,每行代表一个订单
  • 每个订单(行)可以包含多个产品
  • 对于订单(行)中的每个产品,同一行中还有另一组列
  • 我需要将此数据转换为每行仅一组列(即每行一个产品)
  • 产品(新行)需要保持彼此相邻,因此不能将列添加到数组的底部(这更简单)

您能否看看下面的示例并帮助我实现这一目标?

Example Sheet

Screenshot of linked sheet

【问题讨论】:

    标签: google-sheets google-sheets-formula spreadsheet


    【解决方案1】:

    在另一张纸上试试这个

    =SORT({query({Reference!$A5:$A,Reference!B5:F},"select * where Col2 is not null ");query({Reference!$A5:$A,Reference!G5:K},"select * where Col2 is not null ");query({Reference!$A5:$A,Reference!L5:P},"select * where Col2 is not null ")})
    

    【讨论】:

    • 太棒了。感谢您介绍查询功能;)。
    • 你能告诉我为什么这会在附件中产生错误吗? =SORT({query({Input!$A4:$A,Input!D4:H},"select * where Col2 is not null");query({Input!$A4:$A,Input!B4:C} ,"select * where Col2 is not null ")}) 错误:在 ARRAY_LITERAL 中,数组文字缺少一行或多行的值。工作表:docs.google.com/spreadsheets/d/…
    • 因为这里有 6 列 ({Input!$A4:$A,Input!D4:H} A、D、E、F、G 和 H,而这里只有 3 列 {Input!$A4:$A,Input!B4:C} A、B 和 C
    • 啊当然。非常感谢您的及时回复。我将添加虚拟列以解决此问题。
    猜你喜欢
    • 2021-10-08
    • 1970-01-01
    • 2021-06-02
    • 1970-01-01
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-19
    相关资源
    最近更新 更多