What is the easiest way to sum a value column from multiple tables?

startrunmspaint

New Member
Joined
Jan 29, 2014
Messages
5
I'm setting up a new spreadsheet that has multiple tables that each list a date and value (among other fields).

I want to create a summary table that will total the values from each table by date. What is the easiest way to accomplish this? Is there any functionality in Excel 2013 or beyond that can link tables and let me sum using some query or power pivot functionality so that I don't need to click on each table? I anticipate adding more tables during the life of this project so I don't want to see a sumif of Table A + Table B + Table C in my formula.

To clarify:
Table A lists various dates and values
Table B lists various dates and values
Table C lists various dates and values

I would like Table D to total the values from A-C for each date.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
It's pretty easy if your Tables are real Excel-tables and not just ranges.

let
// Access your current Excel-Workbook "from outside" by opening it as a new source: "Get External Data - From File - Excel
Source = Excel.Workbook(File.Contents("........CurrentWorkbook.xlsx"), null, true),

// Filter objects of type "Table" and set additional filters if necessary
Filter = Table.SelectRows(Source, each [Kind] = "Table"),

// Expand your data - you don't have to type in this command, you can also just click if you're building this query manually
#"Expanded Data" = Table.ExpandTableColumn(Filter, "Data", Table.ColumnNames(Filter[Data]{0}), Table.ColumnNames(Filter[Data]{0}))
in
#"Expanded Data"

Please tell if you need a solution for simple ranges instead.
 
Upvote 0
Can you simplify this for me a little bit. I have defined my tables as Excel tables. In this short example, I have Table1 and Table2 each with dates from Jan1 to Jan3 with corresponding values. I want to create a Table3 with a unique dates list from Table1 and Table2 and the total value for all of those dates.
 
Upvote 0
You can do this all by using the UI. Have a look at my rookie-video :-) :https://youtu.be/kq85a8vRjt4

This is how the code will look like:
Code:
let
    Source = Excel.Workbook(File.Contents("C:\Users\Imke\Google Drive\ME_ConsolidateAllTablesAtOnce.xlsx"), null, true),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Kind] = "Table")),
    #"Expanded Data" = Table.ExpandTableColumn(#"Filtered Rows", "Data", {"Amount", "Date"}, {"Amount", "Date"}),
    #"Grouped Rows" = Table.Group(#"Expanded Data", {"Date"}, {{"SumAmount", each List.Sum([Amount]), type number}})
in
    #"Grouped Rows"
 
Upvote 0

Forum statistics

Threads
1,224,159
Messages
6,176,749
Members
452,741
Latest member
Muhammad Nasir Mahmood

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top