Formula or macro to itemise summarised results

saraapple

Board Regular
Joined
Feb 3, 2020
Messages
165
Office Version
  1. 2010
Platform
  1. Windows
I am hoping someone could advise me on the below - or just any ideas that could help.
I want to do the opposite of a pivot table of sorts, my data is summarised and I need to break it down into singles.
The reason I need to break it into singles, is I need to plan loads of say 40 with the potential for each load to have a remainder - hence the need for singles to accurately calculate.

I already have the macro to split the data from singles (I think with a few amendments) but I need to get to singles to test it works!

Here is what I have and what I want:

New Wave File Template Aug 2021.xlsm
ABCDEFGHI
1PriorityStore NumberStore NameSum of Pallet TotalPriorityStore NumberStore NameSum of Pallet Total
21114Jersey21114Jersey1
33865Broadstairs41114Jersey1
44800Canterbury113865Broadstairs1
55265Ashford63865Broadstairs1
6233865Broadstairs1
73865Broadstairs1
84800Canterbury1
94800Canterbury1
104800Canterbury1
114800Canterbury1
124800Canterbury1
134800Canterbury1
144800Canterbury1
154800Canterbury1
164800Canterbury1
174800Canterbury1
184800Canterbury1
195265Ashford1
205265Ashford1
215265Ashford1
225265Ashford1
235265Ashford1
245265Ashford1
2523
Sheet6
Cell Formulas
RangeFormula
A1:D5A1='Stoke 1 Pallets'!F6
D6D6=SUM(D2:D5)
I25I25=SUM(I2:I24)


Is there a function in excel to reverse a pivot table?

Thank you for your time
Sara
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Its is part of a bigger process I have going on.
I have to list orders by priority, then split the summarised data I have into singles (this step) so I can break them down into loads and split loads. My plan was to generate the data, split to singles, run a macro I have to split into groups of 40, then I was going to resummarise the results by pivoting the data.
This is my basic idea, am I going in the wrong direction to achieve my desired result?
Thank you for taking the time :)
 
Upvote 0
I'm not sure the solution below, using formulas with a helper column to make things easier, would help with the process you're developing.
Anyway, look at the solution I found to list in the F:I columns what you showed in post #1.

Cell Formulas
RangeFormula
F2:F25F2=IF(ROWS(F$2:F2)>D$6,"",INDEX(A$2:A$5,MATCH(ROWS(F$2:F2)-1,K$2:K$6)))
G2:H25G2=IF(F2="","",VLOOKUP(F2,A$2:B$5,2,0))
K2:K6K2=SUM(D$1:D1)
I25I25=SUM(I2:I24)


Hope this helps

M.
 
Upvote 0
Hi, thank you again but I don't think this will work as your helper column is on the finished data that I cant currently produce!
I have just been looking at reverse pivot tables - could this be a way?

My data is for example:

Sara 3
Marcelo 5

I want this to become:

Sara 1
Sara 1
Sara1
Marcelo 1
Marcelo 1
Marcelo 1
Marcelo 1
Marcelo 1

Thanks
Sara
 
Upvote 0
Try (untested)
Input on Sheet1
Output on Sheet2
Code:
sub k1()
Lastrow = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
k=0
for i=2 to lastrow
for j=1 to Worksheets("Sheet2").Cells(i,4)
k=k+1
Worksheets("Sheet2").Cells(k,1)=Worksheets("Sheet1".Cells(i,1)
Worksheets("Sheet2").Cells(k,2)=Worksheets("Sheet1".Cells(i,2)
Worksheets("Sheet2").Cells(k,3)=Worksheets("Sheet1".Cells(i,3)
Next j
Next i
End Sub
 
Upvote 0
Thank you - is this trying to put the data into sheet 2?
All my data is in sheet 1 - I have tried amending the above to reflect this but I get a compile error:
1629212541732.png
 
Upvote 0
Hi, thank you again but I don't think this will work as your helper column is on the finished data that I cant currently produce!

I assumed the data in columns A:D were already there (given). Am i wrong?

M.
 
Upvote 0
Sorry my fault, try changing this bit to

Code:
Worksheets("Sheet1").Cells(k,6)=Worksheets("Sheet1".Cells(i,1))
Worksheets("Sheet1").Cells(k,7)=Worksheets("Sheet1".Cells(i,2))
Worksheets("Sheet1").Cells(k,8)=Worksheets("Sheet1".Cells(i,3))

No real need for column I, it will always be 1.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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