查询和转置一长行数据的Google表格

时间:2019-09-18 17:19:39

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

我有很多列的数据行,例如:

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

我尝试了查询和转置的组合,但是没有得到想要的结果。这有可能吗?

1 个答案:

答案 0 :(得分:0)

如果AddTraining工作表类似于:

0

然后您可以使用:

=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))

0


spreadsheet demo