如何在Google表格中转置此数据

时间:2019-11-21 10:34:25

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

我在Google工作表中有数据,我只想在其他工作表中获取该数据,但要转置 例如:

Column A    | Column B    | Column C
=================================
site1.com   | Name 1      | Name 2
site2.com   | Name 3      | Name 4 
site3.com   | Name 5      | Name 6 

想要这样的数据

Column A    | Column B    | Column C
=================================
site1.com   | site2.com   | site3.com
Name 1      | Name 3      | Name 5 
Name 2      | Name 4      | Name 6 

我不想在每一行中手动输入公式,因此arryformula可以自动执行此操作。

我正在尝试此操作,但无法满足我的要求。

=ARRAYFORMULA(TRANSPOSE(Sheet1!$B2:B300 & Sheet1!$L2:L300))

2 个答案:

答案 0 :(得分:1)

尝试:

=ARRAYFORMULA({TRANSPOSE(SORT(FILTER(A:A, A:A<>""))); 
 SUBSTITUTE(TRANSPOSE(SPLIT(TRANSPOSE(QUERY(TRANSPOSE(
 IF(ISNUMBER(QUERY(QUERY({A:B; A:A, C:C}, 
 "select count(Col1) where Col1 is not null group by Col1 pivot Col2"), 
 "offset 1", 0)), SUBSTITUTE(QUERY(QUERY({A:B; A:A, C:C}, 
 "select count(Col1) where Col1 is not null group by Col1 pivot Col2"), 
 "limit 0"), " ", "♦"), )),,999^99)), " ")), "♦" , " ")})

0

答案 1 :(得分:1)

或者您可以做:

=TRANSPOSE(A1:C3)

或:

=TRANSPOSE(INDIRECT("A1:C"&COUNTA(A:A)))

0


更新:

=QUERY(TRANSPOSE(INDIRECT("Sheet1!A2:L"&COUNTA(Sheet1!A2:A)+1)), "offset 1")