Google表格将多列数据转置为行

时间:2019-05-24 11:10:33

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

https://i.stack.imgur.com/fWOec.png

我需要将左侧表格数据转换为Google表格中的右侧表格数据。我不知道要使用哪个公式

1 个答案:

答案 0 :(得分:0)

={"ID", "Task", "Weekday"; 
 ARRAYFORMULA(TRIM(SPLIT(TRANSPOSE(SPLIT(QUERY(IF(LEN(A3:A), 
 "♦"&B3:B&"♥"&A3:A&"♥"&A1&"♦"&D3:D&"♥"&C3:C&"♥"&C1&
 "♦"&F3:F&"♥"&E3:E&"♥"&E1&"♦"&H3:H&"♥"&G3:G&"♥"&G1&
 "♦"&J3:J&"♥"&I3:I&"♥"&I1&"♦"&L3:L&"♥"&K3:K&"♥"&K1&
 "♦"&N3:N&"♥"&M3:M&"♥"&M1, ), , 999^99), "♦")), "♥")))}

Break on exceptions