Transpose columns and rows under the current year

ashley1984

New Member
Joined
Mar 31, 2018
Messages
32
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm using Power Query to clean and transpose a set of data from LY under the same weeks this year. You can see from the below that I have 12 weeks from LY with the same 12 weeks from TY with W/C a Monday

Aug-2020Sep-2020Oct-2020Aug-2021Sep-2021Oct-2021
Category 1Category 4Brandw/c 10-Augw/c 17-Augw/c 24-Augw/c 31-Augw/c 07-Sepw/c 14-Sepw/c 21-Sepw/c 28-Sepw/c 05-Octw/c 12-Octw/c 19-Octw/c 26-Octw/c 09-Augw/c 16-Augw/c 23-Augw/c 30-Augw/c 06-Sepw/c 13-Sepw/c 20-Sepw/c 27-Sepw/c 04-Octw/c 11-Octw/c 18-Octw/c 25-Oct
Product 1Ingredient 1Brand ASave £1.00Save £x.00Save £x.00
Product 2Ingredient 2Brand ASave £x.00Save £x.00Save £x.00
Product 3Ingredient 3Brand ASave £x.00Save £x.00
Product 4Ingredient 4Brand BSave £x.00Save £x.00
Product 5Ingredient 5Brand BSave £x.00Save £x.00
Product 6Ingredient 6Brand BSave £x.00Save £x
Product 7Ingredient 7Brand BSave £x.00Save £x.00Save £x
Product 8Ingredient 8Brand BSave £x.00Save £x.00
Product 9Ingredient 9Brand BSave £x.00Save £x
Product 10Ingredient 10Brand CSave £x.00Save £xSave £x
Product 11Ingredient 11Brand CSave £0.50Save £x.00Save £x
Product 12Ingredient 12Brand CSave 25%Save £x.00
Product 13Ingredient 13Brand CSave £0.20Save £x.00Save £x.00
Product 14Ingredient 14Brand CSave £x.00Save £x
Product 15Ingredient 15Brand CSave £x
Product 16Ingredient 16Brand CSave £x.00
Product 17Ingredient 17Brand CSave £x.00Save £x.00Save £x
Product 18Ingredient 18Brand CSave £x
Product 19Ingredient 19Brand DSave £x.00Save £x.00
Product 20Ingredient 20Brand DSave £x.00Save £x.00Save £xSave £x
Product 21Ingredient 21Brand DSave £x.00Save £x.00
Product 22Ingredient 22Brand DSave £x.00Save £x.00
Product 23Ingredient 23Brand DSave £x
Product 24Ingredient 24Brand DSave £x
Product 25Ingredient 25Brand DSave £x
Product 26Ingredient 26Brand DSave £xSave £x
Product 27Ingredient 27Brand DSave £x
Product 28Ingredient 28Brand DSave £x
Product 29Ingredient 29Brand DSave £x
Product 30Ingredient 30Brand DSave £x
Product 31Ingredient 31Brand DSave £x
Product 32Ingredient 32Brand DSave £x
Product 33Ingredient 33Brand DSave £xSave £x



The output I am looking for is:

Aug-2021Sep-2021Oct-2021
Category 1Category 4Brandw/c 09-Augw/c 16-Augw/c 23-Augw/c 30-Augw/c 06-Sepw/c 13-Sepw/c 20-Sepw/c 27-Sepw/c 04-Octw/c 11-Octw/c 18-Octw/c 25-Oct
Product 1Ingredient 1Brand ASave £x.00Save £x.00
Product 2Ingredient 2Brand ASave £x.00Save £x.00
Product 3Ingredient 3Brand ASave £x.00
Product 4Ingredient 4Brand BSave £x.00
Product 5Ingredient 5Brand BSave £x.00
Product 6Ingredient 6Brand BSave £x
Product 7Ingredient 7Brand BSave £x.00Save £x
Product 8Ingredient 8Brand BSave £x.00
Product 9Ingredient 9Brand BSave £x
Product 10Ingredient 10Brand CSave £xSave £x
Product 11Ingredient 11Brand CSave £x.00Save £x
Product 12Ingredient 12Brand CSave £x.00
Product 13Ingredient 13Brand CSave £x.00
Product 14Ingredient 14Brand CSave £x
Product 15Ingredient 15Brand CSave £x
Product 16Ingredient 16Brand CSave £x.00
Product 17Ingredient 17Brand CSave £x.00Save £x
Product 18Ingredient 18Brand CSave £x
Product 19Ingredient 19Brand DSave £x.00
Product 20Ingredient 20Brand DSave £x.00Save £xSave £x
Product 21Ingredient 21Brand DSave £x.00
Product 22Ingredient 22Brand DSave £x.00
Product 23Ingredient 23Brand DSave £x
Product 24Ingredient 24Brand DSave £x
Product 25Ingredient 25Brand DSave £x
Product 26Ingredient 26Brand DSave £xSave £x
Product 27Ingredient 27Brand DSave £x
Product 28Ingredient 28Brand DSave £x
Product 29Ingredient 29Brand DSave £x
Product 30Ingredient 30Brand DSave £x
Product 31Ingredient 31Brand DSave £x
Product 32Ingredient 32Brand DSave £x
Product 33Ingredient 33Brand DSave £xSave £x
Aug-2020Sep-2020Oct-2020
Category 1Category 4Brandw/c 10-Augw/c 17-Augw/c 24-Augw/c 31-Augw/c 07-Sepw/c 14-Sepw/c 21-Sepw/c 28-Sepw/c 05-Octw/c 12-Octw/c 19-Octw/c 26-Oct
Product 1Ingredient 1Brand ASave £1.00
Product 2Ingredient 2Brand ASave £x.00
Product 3Ingredient 3Brand ASave £x.00
Product 4Ingredient 4Brand BSave £x.00
Product 5Ingredient 5Brand BSave £x.00
Product 6Ingredient 6Brand BSave £x.00
Product 7Ingredient 7Brand BSave £x.00
Product 8Ingredient 8Brand BSave £x.00
Product 9Ingredient 9Brand BSave £x.00
Product 10Ingredient 10Brand CSave £x.00
Product 11Ingredient 11Brand CSave £0.50
Product 12Ingredient 12Brand CSave 25%
Product 13Ingredient 13Brand CSave £0.20Save £x.00
Product 14Ingredient 14Brand CSave £x.00
Product 15Ingredient 15Brand C
Product 16Ingredient 16Brand C
Product 17Ingredient 17Brand CSave £x.00
Product 18Ingredient 18Brand C
Product 19Ingredient 19Brand DSave £x.00
Product 20Ingredient 20Brand DSave £x.00
Product 21Ingredient 21Brand DSave £x.00
Product 22Ingredient 22Brand DSave £x.00
Product 23Ingredient 23Brand D
Product 24Ingredient 24Brand D
Product 25Ingredient 25Brand D
Product 26Ingredient 26Brand D
Product 27Ingredient 27Brand D
Product 28Ingredient 28Brand D
Product 29Ingredient 29Brand D
Product 30Ingredient 30Brand D
Product 31Ingredient 31Brand D
Product 32Ingredient 32Brand D
Product 33Ingredient 33Brand D



The same brand might not have the saving applied to this year, which is fine. That's exactly why I'm doing this report

At the moment I am manually cutting the data and pasting it underneath and cleaning the data. I'm also doing this across several files and having to do this every 4 weeks. I'm hoping Power Query can do the heavy lifting for me.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,692
Messages
6,173,860
Members
452,535
Latest member
berdex

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