Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
403 views
in Technique[技术] by (71.8m points)

google sheets - ArrayFormula expand to a whole column

I have this formula that splits 7 columns into 84 columns.

=arrayformula(SPLIT(arrayformula(join(";",rept(B2:H2&";",12))),";"))

I'd like to use the arrayformula but for the entire rows without having to copy the formula.

I tried the following but it doesn't work: =arrayformula(SPLIT(arrayformula(join(";",rept(B2:B:H2:H&";",12))),";"))

https://docs.google.com/spreadsheets/d/1qtl_HVMHelT59-ysk8q0-CzuxOt9RWLbYe0ANUW9G6U/edit?usp=sharing

Thank you!

question from:https://stackoverflow.com/questions/65889869/arrayformula-expand-to-a-whole-column

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

JOIN() only accepts a 1 dimensional array argument so we need to use other functions to 'join' the entries:

You can use:

=ArrayFormula(split(transpose(query(transpose(rept(B2:H8&";",12)),,50000)),";"))

Sample Sheet:

enter image description here

References:

Concatenate 2D array to single column

TRANSPOSE()

QUERY()


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...