Skilz Work
Skilz Work

Reputation: 31

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"

Upvotes: 0

Views: 1174

Answers (2)

Martín
Martín

Reputation: 10187

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))))

Upvotes: 1

abdemirza
abdemirza

Reputation: 659

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")

Upvotes: 0

Related Questions