Create table with entries repeated if their quantity is greater than 1

UncleBajubjubs

Board Regular
Joined
Jul 11, 2017
Messages
111
Office Version
  1. 2010
I'm trying to make a table for planning the construction of several different designs. Currently there are 11 different designs, totaling 17 builds.


OrderDesignQuantity to build
1​
A
1​
2​
B
1​
3​
C
2​
4​
D
1​
5​
E
1​
6​
F
1​
7​
G
4​
8​
H
2​
9​
I
2​
10​
J
1​
11​
K
1​

The user will change the order column to set the build order.
This table will generate a second table, which lists the build order for all 17.


Build OrderDesign
1​
A
2​
B
3​
C
4​
C
5​
D
6​
E
7​
F
8​
G
9​
G
10​
G
11​
G
12​
H
13​
H
14​
I
15​
I
16​
J
17​
K

The first line is easy, as it can just lookup whichever Design is first. But then the second line will have to check the quantity of the first design, and either repeat that design if the quantity is 2 or more, or go to the next design. So since design C is quantity 2, it is build 3 and 4, and Design D, the 4th design, is the fifth build.
I'm not sure the most efficient way to make this table operate. I could probably make it work with a ton of if statements, but I'm assuming there's a more elegant formula I can use.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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
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’)
It's 2010, I've just updated, thanks!
 
Upvote 0
Thanks for that (y)
How about
Fluff.xlsm
ABCDEFG
1OrderDesignQuantity to buildBuild OrderDesign
21A111A
32B122B
43C243C
54D154C
65E165D
76F176E
87G4117F
98H2138G
109I2159G
1110J11610G
1211K11711G
1312H
1413H
1514I
1615I
1716J
1817K
19  
20  
Main
Cell Formulas
RangeFormula
F2:F20F2=IF(G2="","",N(F1)+1)
G2:G20G2=IF(ROWS(G$2:G2)>SUM($C$2:$C$12),"",INDEX($B$2:$B$12,AGGREGATE(15,6,(ROW(B$2:B$12)-ROW($B$2)+1)/(ROWS(G$2:G2)<=$D$2:$D$12),1)))
D2:D12D2=SUM(C$2:C2)
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,753
Members
449,094
Latest member
dsharae57

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