简体   繁体   中英

join few columns with importrange

I wish to join few columns in a importrange,

i am using this formula here =importrange("URL", "A1:J3") "i would like to join A, D, H here" ; importrange("URL", "L1:Z3") "and to join M, P here"

Do you want to concatenate row by row those columns of the imported ranges?

Something like this?? Used INDEX to refer to the columns in each row. If needed you can change CONCATENATE with JOIN or TEXTJOIN to add some separator:

=BYROW(IMPORTRANGE(URL,"A1:J3"),LAMBDA(each, CONCATENATE(INDEX(each,,1),INDEX(each,,4),INDEX(each,,8))))

In Google Sheets, you can use the QUERY function to join specific columns from multiple IMPORTRANGE functions as I previously described.

I have added the code of joining A, D, H from the first IMPORTRANGE function, and columns M, P from the second IMPORTRANGE function:

=QUERY({IMPORTRANGE("URL", "A1:J3"), IMPORTRANGE("URL", "L1:Z3")}, "SELECT Col1, Col4, Col8, Col13, Col16")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM