工作表公式以转置,拆分和重复多列

时间:2019-12-06 14:07:51

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

我正在寻找一个脚本,该脚本将按另一个单元格中的值对多列进行转置,拆分和重复。

我将它用于一列,但想知道是否可以对多列进行:

=TRANSPOSE(SPLIT(REPT(C2 & ",",A2),",",false,true))

工作表:

https://docs.google.com/spreadsheets/d/1W5kFTNF6g0DI1W_lHJJU91CBwL_YnEiLLb_NYH7GkLQ/edit?usp=sharing

2 个答案:

答案 0 :(得分:0)

以下代码将完全按照您的要求输出。

=arrayformula({transpose(split(concatenate(rept(B2:B4 & ",",A2:A4^2)),",",false,true)),transpose(split(concatenate(REPT(C2:C4 & ",",A2:A4)),",",false,true))})

答案 1 :(得分:0)

或尝试以下简短的方法:

=ARRAYFORMULA({TRANSPOSE(SPLIT(CONCATENATE(REPT(B2:B&",", A2:A^2)), ",")), 
               TRANSPOSE(SPLIT(CONCATENATE(REPT(C2:C&",", A2:A)),   ","))})

0