Stacking a table with a number of data columns into a table with just one column of data

CA_User

Board Regular
Joined
Nov 5, 2004
Messages
126
Hello. I am trying to stack data from a table with the the data stored in columns going across but I want it in a vertical view. I've attached two images. One with the raw format and the 2nd with the format I want the end result to look like. The number of columns could vary by month as some months could have 5 days of data and other months, it's 15 days of data. Each day is currently in a separate column. The number of rows also differ from month to month.

I'm looking for VBA cold to stack each day on top of each other and have the "day #" be a column of it's own. I tried to record data but it doesn't work since the data set is dynamic. Could someone please help?
 

Attachments

  • Raw Data.png
    Raw Data.png
    15 KB · Views: 30
  • Desired Result.png
    Desired Result.png
    34.5 KB · Views: 29

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Screenshot 2022-11-11 161123.pngScreenshot 2022-11-11 161228.png set up pivot with rows and values as they are here then in Pivot table design select repeat all item labels, No sub-totals and Tabular format
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,597
Members
449,038
Latest member
Arbind kumar

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