我有这样的一排:
Alex
Bob
Chris我需要一个函数为每一行创建三行,如下所示:
Alex
Alex
Alex
Bob
Bob
Bob
Chris
Chris
Chris我怎么能这么做?
发布于 2020-06-09 23:23:30
我相信你的目标如下。
- From亚历克斯·鲍勃·克里斯
-至
亚历克斯鲍勃克里斯
为了这个,这个答案怎么样?
样本公式:
=ARRAYFORMULA(TRANSPOSE(SPLIT(TEXTJOIN("#",TRUE,SUBSTITUTE("###","#",A1:A3&"#")),"#")))1. Create the base 3 rows using `SUBSTITUTE("###","#",A1:A3&"#")` as a string.
- For example, `Alex` becomes `Alex#Alex#Alex#`.
1. Merge each string of each source rows using `TEXTJOIN`.
- For example, `Alex, Bob, Chris` becomes `Alex#Alex#Alex##Bob#Bob#Bob##Chris#Chris#Chris#`.
1. Split the string using `SPLIT`.
- By this, each value is put to each cell.
1. Transpose the values using `TRANSPOSE`.
- By this, the result value can be retrieved.
=TRANSPOSE(ARRAYFORMULA(SPLIT(TEXTJOIN("#",TRUE,SUBSTITUTE("###","#",A1:A3&"#")),"#")))也可以检索相同的结果。结果:

注意:
#,请修改为其他字符。参考文献:
https://stackoverflow.com/questions/62291504
复制相似问题