Stack columns but keep first 5

teddzoon

New Member
Joined
Sep 3, 2018
Messages
2
Hi,

I've been looking around to try and figure out how to most efficient stack columns.

My data (which is updated daily, hence have different amount of rows each day) currently have an output like this:
CompanyNameCode1NameCode2NameYearStarting ValueTotal ValueOctoberNovemberDecemberJanuaryFebMarch
1XX99YY123Sales2018050080857540100120
2XY99YY123Sales2018040040402020120160

<tbody>
</tbody>

I would like to stack the months, so my output would look something like this:

CompanyNameCode1NameCode2NameYearStarting ValueTotal ValueMonthAmount
1XX99YY123Sales20180500October80
1XX99YY123Sales20180500November85
1XX99YY123Sales20180500December75
etc

<tbody>
</tbody>


I tried recording a macro, but it did not handle different number of rows correctly.
So when I used the output on fewer rows, it still pasted values on fixed cells, instead of using "next empty cell available".

Have you got any magic tricks for me?

Kind Regards
Ted
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to the board. A pivot table can do this for you, removing need for macros.

Lots of online guides and tutorials on pivot tables for you to read up on.
 
Last edited:
Upvote 0
Hi JackDanIce,

Then it might be something I'm missing completely. I've googled around quite a bit and not really found anything.
If I put the data in Pivot, and drag my columns to rows instead, I still dont get the desired outcome. The columns still put themselves in columns.

See this:
https://imgur.com/a/AQxORX1

It still does not stack the columns into a single coloumn.
What am I missing?

CompanyNameCode1NameCode2NameYearStarting ValueTotal ValueMonthValue
1XX99YY123Sales20180500October80
1XX99YY123Sales20180500November85
...
2XY99YY123Sales20180400March160

<tbody>
</tbody>



Cheers,
Ted
 
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

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