Qty: =A2:A6
Prices: = B2:B6
Cumulative: = C3:C7
PrevCumulative: =C2:C6
Size: = F3
E4: =(ROWS(E$4:E4)-1)*Size+1 & " to " & ROWS(E$4:E4)*Size
F4:<rows(f$4:f4)*size)*if(qty<if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)),qty,if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)))) size,"-")="" array="" entered
<rows(f$4:f4)*size)*if(qty<if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)),qty,if(qty-(cumulative-rows(f$4:f4)*size) <="" qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative))))="" size,"-")="" array="" entered
<rows(f$4:f4)*size)*if(qty<if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)),qty,if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)))) size,"-")
=IF(C$7>=ROWS(F$4:F4)*Size,SUMPRODUCT(Prices,(Cumulative>(ROWS(F$4:F4)-1)*Size)*(PrevCumulative < ROWS(F$4:F4)*Size)*IF(Qty < IF(Qty-(Cumulative-ROWS(F$4:F4)*Size) < Qty-((ROWS(F$4:F4)-1)*Size-PrevCumulative),Qty-(Cumulative-ROWS(F$4:F4)*Size),Qty-((ROWS(F$4:F4)-1)*Size-PrevCumulative)),Qty,IF(Qty-(Cumulative-ROWS(F$4:F4)*Size) < Qty-((ROWS(F$4:F4)-1)*Size-PrevCumulative),Qty-(Cumulative-ROWS(F$4:F4)*Size),Qty-((ROWS(F$4:F4)-1)*Size-PrevCumulative))))/Size,"-") Array entered
| A | B | C | D | E | F |
---|
| | | | | | |
| | | | | | |
Weighted Av | | | | | | |
1 to 3 | | | | | | |
4 to 6 | | | | | | |
7 to 9 | | | | | | |
10 to 12 | | | | | | |
13 to 15 | | | | | | |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]Quantity[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]Price[/TD]
[TD="align: right"]Cumulative[/TD]
[TD="align: right"][/TD]
[TD="align: right"]Group Size[/TD]
[TD="align: right"]3[/TD]
[TD="align: center"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]34.00[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]34.50[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]22.34[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"][/TD]
[TD="align: right"]34.17[/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]34.22[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"]30.35[/TD]
[TD="align: center"]6[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]43.22[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"]37.22[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"]-[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]-[/TD]
</tbody>
</rows(f$4:f4)*size)*if(qty<if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)),qty,if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative))))></rows(f$4:f4)*size)*if(qty<if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)),qty,if(qty-(cumulative-rows(f$4:f4)*size)></rows(f$4:f4)*size)*if(qty<if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative)),qty,if(qty-(cumulative-rows(f$4:f4)*size)<qty-((rows(f$4:f4)-1)*size-prevcumulative),qty-(cumulative-rows(f$4:f4)*size),qty-((rows(f$4:f4)-1)*size-prevcumulative))))>