As Ali indicated. A fairly simple task for Power Query. Mcode:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Customer Location.", Int64.Type}, {"Plant Desc.", type text}, {"Product", Int64.Type}, {"Prod.Desc.", type text}, {"Unit of Measure", type text}, {"Deliv. Date", type date}, {"Document Qty.", Int64.Type}}),
#"Inserted Start of Month" = Table.AddColumn(#"Changed Type", "Start of Month", each Date.StartOfMonth([Deliv. Date]), type date),
#"Removed Columns" = Table.RemoveColumns(#"Inserted Start of Month",{"Deliv. Date"}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Removed Columns", {{"Start of Month", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Removed Columns", {{"Start of Month", type text}}, "en-US")[#"Start of Month"]), "Start of Month", "Document Qty.")
in
#"Pivoted Column"
Excel 2016 (Windows) 32 bit
|
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
1 |
Customer Location. |
Plant Desc. |
Product |
Prod.Desc. |
Unit of Measure |
12/1/2020 |
1/1/2020 |
2/1/2020 |
6/1/2021 |
1/1/2021 |
2/1/2021 |
2 |
11111 |
Customer - 1 |
1075176 |
Product Description |
KG |
|
|
|
50 |
|
|
3 |
11111 |
Customer - 1 |
10046903 |
Product Description |
KG |
50 |
534 |
890 |
|
|
|
4 |
22222 |
Customer - 2 |
10045134 |
Product Description |
KG |
|
|
|
174 |
1234 |
806 |
5 |
22222 |
Customer - 2 |
10049999 |
Product Description |
KG |
|
25 |
|
|
|
|
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").
It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.
- Follow this link to learn how to install Power Query in Excel 2010 / 2013.
- Follow this link for an introduction to Power Query functionality.
- Follow this link for a video which demonstrates how to use Power Query code provided.
Bookmarks