google-sheets - 查询并转置一长行数据 Google Sheets
问题描述
我有很多列的数据行,例如:
Date=Team2:Date Date Exercise 1 Reps Weight Team Exercise 2 Reps Weight
9/18/2019 9/18/2019 chinup 10 2 2 situp 10 3
我想将数据拉到另一张表中,如下所示:
Date=Team2:Date Exercises Reps Weight Team
9/18/2019 chinup 10 2 2
9/18/2019 situp 10 3 2
我尝试了查询和转置的组合,但没有得到我想要的结果。这可能吗?
解决方案
如果 AddTraining 表是这样的:
那么你可以使用:
=ARRAYFORMULA(QUERY({
AddTraining!A2:A, AddTraining!C2:E;
AddTraining!A2:A, AddTraining!G2:I;
AddTraining!A2:A, AddTraining!J2:L;
AddTraining!A2:A, AddTraining!N2:P;
AddTraining!A2:A, AddTraining!R2:T;
AddTraining!A2:A, AddTraining!U2:W;
AddTraining!A2:A, AddTraining!X2:Z;
AddTraining!A2:A, AddTraining!AA2:AC},
"where Col2 is not null
order by Col1", 0))
电子表格演示
推荐阅读
- php - 如果您没有多少输入,如何制作表格?
- javascript - 如何在 Mocha 测试框架中按顺序同步调用异步函数?
- sql - 无法在查询中使用添加的列
- java - 视图中的 setBackground 无法应用
- node.js - 如何在 Visual Studio Code 中运行 npm 命令?
- python - 如何使用 Popen.communicate 输入几个参数?
- android - FireMonkey 对话框未全屏
- angular - InjectionToken vs Injectable
- python - 如何通过搜索返回 Numpy 数组的索引
- cqrs - 处理 CQRS 中的“有效”重复命令