1

I want to import data from one sheet to another using Query Importrange, however I want to select a column that should not be imported directly after the previous column import, for example; I select Col1, Col2,Col3,Col6 from sheet 1 but Col6 should appear in a specified column not the following column to where Col3 was placed.

Currently I am using this formula:

=IFERROR(QUERY({IMPORTRANGE("/13Ptmj3sejlOADvwhgfBPxRy_H-RGCxLX4r2jecbceIE/", "Sheet2!A2:F")}, "Select Col1,Col2,Col3 where Col1 >= date '2022-09-01' and Col1 <= date '2022-09-30'" ,0))

Sheet1!A2 should be where it all starts so Col6 from sheet2! would need to be placed in Col7 in sheet2!

This may not even be possible but it would be preferable to do it this way rather than entering another formula

1 Answer 1

1

here is how you offset Col6 by one column:

=IFERROR(QUERY(
 {IMPORTRANGE("13Ptmj3sejlOADvwhgfBPxRy_H-RGCxLX4r2jecbceIE", "Sheet2!A2:F")}, 
 "select Col1,Col2,Col3,' ',Col6 
  where Col1 >= date '2022-09-01' 
    and Col1 <= date '2022-09-30'
  label' '''", 0))

or by 3 columns:

=IFERROR(QUERY(
 {IMPORTRANGE("13Ptmj3sejlOADvwhgfBPxRy_H-RGCxLX4r2jecbceIE", "Sheet2!A2:F")}, 
 "select Col1,Col2,Col3,' ','  ','   ',Col6 
  where Col1 >= date '2022-09-01' 
    and Col1 <= date '2022-09-30'
  label' ''','  ''','   '''", 0))
Sign up to request clarification or add additional context in comments.

1 Comment

thank you, that is seriously cool 😎

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.