Google 表格 - 如何转换表格数据

问题描述 投票:0回答:1

我有一个带有 ID 和数值的数据,按列中的日期组织,如下所示

集群ID 位置。 2024-01-01 位置。 2024-01-02 ...... 位置。 2024-03-24
100015 1053 1027 ...... 327
230022 9002 ...... 101
...... ......
320024 74 98 ...... 2

我想将这些数据放在行中:

集群ID 位置 日期
100015 1053 2024-01-01
100015 1027 2024-01-02
100015 .... ....
100015 327 2024-03-24
100022 2024-01-01
100022 9002 2024-01-02
100022 .... ....
100022 101 2024-03-24
100024 74 2024-01-01
100024 98 2024-01-02
100024 .... ....
100024 2 2024-03-24

我尝试了 transpose() 和查询,但在我的样本中遇到了大量的列。

这里是 GS 中一些数据的链接:https://docs.google.com/spreadsheets/d/186hcvRHUAN3VRPwMO5jaZbF8ozft-waxTGpCCh-uPFQ/edit?usp=sharing

google-sheets google-sheets-formula
1个回答
0
投票

这是您可以测试的一种方法:

=let(Σ,tocol(,1), reduce(Σ,Sheet1!B2:index(Sheet1!CG:CG,match(,0/(Sheet1!A:A<>""))),lambda(a,c,vstack(if(iserror(a&""),Σ,a),
                  if(len(c),hstack(index(Sheet1!A:A,row(c)),c,mid(index(Sheet1!1:1,column(c)),6,10)),Σ)))))

© www.soinside.com 2019 - 2024. All rights reserved.