Forum Discussion

user12690's avatar
user12690
Copper Contributor
Sep 14, 2022
Solved

Question about combining data from multiple tables

Hi,

My problem is a bit complicated, but I suspect that the solution isn't too difficult.

I have 3 tables, on 3 different sheets in my workbook. They contain a list of data with one column "priority" and one column "expected price".

On a fourth sheet, I would like to chronologically sort this data priority first (ascending) and price second (also ascending).

So first I want to see all the items with priority 1, sorted cheapest to most expensive, then priority 2 and so on.

 

Can anyone help in this regard? If you need more info, feel free to ask.

 

Thank you in advance! 

5 Replies

    • user12690's avatar
      user12690
      Copper Contributor
      I already figured it out. It was =SORT(VSTACK(Table1,Table2,Table3),{1,10},{1,1})
      since the data is on the 10th row.
      Thanks again!
      • Patrick2788's avatar
        Patrick2788
        Silver Contributor

        user12690 

        Here's another approach to picking out the columns:

         

        =LET(arr_constant,{"Priority","Price"},stack,VSTACK(Table1,Table2,Table3),select_col,CHOOSECOLS(stack,XMATCH(arr_constant,Table1[#Headers])),VSTACK(arr_constant,SORT(select_col,{1,2},{1,1})))

         

    • user12690's avatar
      user12690
      Copper Contributor
      Hi,
      Thank you for your response!
      I do have the latest version with 365 (mac though)
      What I forgot to mention is that the tables are made up of many more columns, but the 2 I need to sort by are priority and price.
      How would you handle this if in your workbook on sheet 1, 2 and 3 there were multiple columns, but you only want to see priority and price?
      Thanks again!
  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor
    What is your excel version? Do you have Excel-365 with most recent release? You need VSTACK() and SORT() function. Share a sample workbook.

Resources