Search code examples
google-sheetsgoogle-sheets-query

Merge multiple tables


I have lots of sheets describing different kind of expenses and gains of my small company, and I find no easy way to merge my tables like in this example I made:

Merging tables in Google Sheets goal

I want the last table to be auto filled with the lines of the others tables when I update them, so I can foresee the expenses and gain in time (by ordering the green table automatically by date ascending).

By now the only temp solution I found is to copy references to the other tables lines (yellow and blue) in the merging table (green) in advance.

Pivot tables do not permit to achieve this kind of gathering on several tables.


Solution

  • Use this Query formula in cell I2:

    =QUERY({A2:C; E2:G}, "select * where Col1 is not null", 1)
    

    To also order them by Date, add the order by:

    =QUERY({A2:C; E2:G}, "select * where Col1 is not null order by Col1", 1)