Consolidate growing tables

Leeds Knight

New Member
Joined
Jun 17, 2010
Messages
2
I have two named Tables detailing price proposals from mfrs on different dates

I want to merge these into a single table detailing the minimum cost and associated detail per Item

ItemMfrMPNCost
10001AcmeACME0011
10002Bob'sBOB0011.5
10003Tom'sTOM0012

<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>
</tbody>

ItemMfrMPNCost
10001Bob'sBOB0021.5
10003Tom'sTOM0010.5
10004Bill'sBILL0014

<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>
</tbody>

Requirement - single table by Item number, telling me who has provided the lowest quote with which MPN value:

ItemMfrMPNMin Cost
10001AcmeACME0011
10002Bob'sBOB0011.5
10003Tom'sTOM0010.5
10004Bill'sBILL0014

<colgroup><col span="3"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
like this?

ItemMfrMPNMin of Cost
10001​
Bob'sBOB002
1.5​
10001​
AcmeACME001
1​
10002​
Bob'sBOB001
1.5​
10003​
Tom'sTOM001
0.5​
10004​
Bill'sBILL001
4​

with PowerQuery (Get&Tranaform)

Code:
[SIZE=1]let
    Source = Table.Combine({Table1, Table2}),
    Group = Table.Group(Source, {"Item", "Mfr", "MPN"}, {{"Count", each _, type table}}),
    Min = Table.AggregateTableColumn(Group, "Count", {{"Cost", List.Min, "Min of Cost"}})
in
    Min[/SIZE]
 
Last edited:
Upvote 0
or

ItemMfrMPNMin of Cost
10001​
AcmeACME001
1​
10002​
Bob'sBOB001
1.5​
10003​
Tom'sTOM001
0.5​
10004​
Bill'sBILL001
4​

but with longer code (Power Query aka Get&Transform)

Code:
[SIZE=1]// Append1
let
    Source = Table.Combine({Table1, Table2}),
    Group = Table.Group(Source, {"Mfr"}, {{"Count", each _, type table}}),
    ItemList = Table.AddColumn(Group, "Item", each List.Distinct(Table.Column([Count],"Item"))),
    ExpandItem = Table.ExpandListColumn(ItemList, "Item"),
    MPNList = Table.AddColumn(ExpandItem, "MPN", each List.Distinct(Table.Column([Count],"MPN"))),
    ExpandMPN = Table.ExpandListColumn(MPNList, "MPN"),
    Min = Table.AggregateTableColumn(ExpandMPN, "Count", {{"Cost", List.Min, "Min of Cost"}}),
    DeDup = Table.Distinct(Min, {"Mfr"}),
    Reorder = Table.ReorderColumns(DeDup,{"Item", "Mfr", "MPN", "Min of Cost"})
in
    Reorder[/SIZE]
 
Last edited:
Upvote 0
Ah-ha! Thanks Sandy666 - I didn't quite understand your code (still learning), but you got me thinking...

Final solution:
Click on Table1 > Data Tab > Get & Transform Data ribbon > From Table/Range > Close & Load
Click on Table2 > Data Tab > Get & Transform Data ribbon > From Table/Range > Close & Load
Data Tab > Get & Transform Data ribbon > Get Data > Combine Queries > Append

Primary Table = Table 1
Table to append to the primary table = Table 2
OK
Close & Load

I do end up with duplicate sheets though... :)
 
Upvote 0
see in the File

there are two results out of which one (your expected result), in my opinion, is incorrect due to various ITEMs and MPNs. IMO post#2 has proper result.

ItemMfrMPNMin
10003​
Tom'sTOM001
0.5​
10001​
AcmeACME001
1​
10001​
Bob'sBOB002
1.5​
10002​
Bob'sBOB001
1.5​
10004​
Bill'sBILL001
4​
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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