Search code examples
arraysgoogle-sheetsgoogle-sheets-formulagoogle-sheets-queryimportrange

Combine 3 sheets into one with importrange


Goal: Merge 2 sheets into the main sheet all in one sheet via importrange Problem: All the columns are in different orders

enter image description here

I would like to importrange the 2 sheets in client master sheet 2 into the main sheet in one table. Is that possible while the columns are not in the same orders?


Solution

  • use:

    ={QUERY(IMPORTRANGE("1Er_6mSY5TFJ5sb_DDRc6QY3aIzqen_QfVYg3FvBFZ3I", "Sheet 2!A2:E"),
     "select Col2,Col3,Col1,Col5,Col4 where Col1 is not null", 0);
      QUERY(IMPORTRANGE("1Er_6mSY5TFJ5sb_DDRc6QY3aIzqen_QfVYg3FvBFZ3I", "Sheet 3!A2:E"),
     "select Col2,Col4,Col1,Col3,Col5 where Col1 is not null", 0)}
    

    0