With Power Query
1.Load your table to the PQ Editor
2.Duplicate your table
3.In the Duplicate table, enact this Mcode
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Removed Duplicates" = Table.Distinct(Source, {"Index"})
in
#"Removed Duplicates"
4. Perform a full outer join on the original table and the duplicate table.
let
Source = Table.NestedJoin(Table2, {"Index", "Value"}, #"Table2 (2)", {"Index", "Value"}, "Table2 (2)", JoinKind.FullOuter),
#"Expanded Table2 (2)" = Table.ExpandTableColumn(Source, "Table2 (2)", {"Index"}, {"Index.1"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Table2 (2)",{"Index"}),
#"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Index.1", "Value"}),
#"Renamed Columns" = Table.RenameColumns(#"Reordered Columns",{{"Index.1", "Index"}})
in
#"Renamed Columns"
Excel 2016 (Windows) 64 bit
|
A |
B |
C |
D |
E |
1 |
Index |
Value |
|
Index |
Value |
2 |
0001 |
2 |
|
0001 |
2 |
3 |
0002 |
3 |
|
0002 |
3 |
4 |
0001 |
7 |
|
|
7 |
5 |
0002 |
10 |
|
|
10 |
6 |
0003 |
11 |
|
0003 |
11 |
7 |
0002 |
10 |
|
|
10 |
Bookmarks