Sequential Calculations

Rik76

New Member
Joined
Feb 4, 2019
Messages
9
Hi,

I'm have a large data set and am trying to identify a formula that will make a calculation based on the sequence number. Example below.

From a lookup I have identified that a quantity of 3 are packed, but I want the 3 to be deducted from the first schedule line only, and if the schedule quantity is less than the packed quantity, to deduct the remainder from the next sequence and so on.

In the case of the below, in the sequence qty column, the results should read: 2 for sequence 1, 1 for sequence 2 and 0 for sequence 3.

Anyone have any ideas? I'm hoping its possible! :) Thanks in advance to anyone that can help

ORDER No_ITEM NoTotal Order QuantitySequence NumberSequence QtyPacked Qty
6075_106123
6075_106213
6075_106333

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
<strike></strike>
<strike></strike>

<tbody>
</tbody>
 
so packed quantity is really "stock level" and sequence is really "order quantity"

so as you produce more stock, stock level rises, and as you dispatch orders stock level diminishes. Planned stock dispatch is scheduled according to customer requirements and is either dispatched on time or late ??? Not being pedantic, but still struggling to understand the issue !

Don't think you're being pedantic at all; I really appreciate you taking the time to help. I guess to simply what I'm trying to achieve, I'll use another example as I may be over complicating things for the purposes of explanation (I've been known to do that! :))

STEP 1: LOOKUP value in column A in another table. This returns a value of 3
STEP 2: Take the value in column E and deduct the returned value of 3 from the first sequence number in column C. As the value of 3 if greater than the value in column D for the first sequence, go to the next sequential number (2) and deduct the remaining value from that sequence. Continue until the full returned value of 3 has been deducted from one of more lines as necessary to deduct the full qty.

ORDER No_ITEM NoTotal Order QuantitySequence NumberSequence QtyPacked Qty
6075_106122
6075_106211
6075_106330

<tbody>
</tbody>
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Take the value in column E and deduct the returned value of 3 from the first sequence number in column C.

ie take 2, and deduct 3 from sequence number in col C

ie take 2 and deduct 3 from 1

did you mean sequence quantity ? Sorry I just don't get it......
 
Upvote 0
Take the value in column E and deduct the returned value of 3 from the first sequence number in column C.

ie take 2, and deduct 3 from sequence number in col C

ie take 2 and deduct 3 from 1

did you mean sequence quantity ? Sorry I just don't get it......

[h=3]What I am ultimately trying to do, is when there is more than one sequence line for an item, I want to distribute the total "packed" quantity (whatever that may be) for the item across the schedule lines according to the sequence. [/h]
 
Upvote 0
so if 5 sequence lines and there are 35 packed items, assign 7 to each sequence ?


The sequence qty determines how many are assigned.....so in the example, as total 3 are packed, sequence 1 calls for qty 2, so 2 would be assigned, with 1 left over. As there is a left over qty, it then goes to sequence 2 and assigns to that, which in this instance is 1.

Sequence NumberSequence QtyPacked Qty
122
211
330

<colgroup><col><col span="2"></colgroup><tbody>
</tbody>

Using the example of 5 sequence lines, with 35 packed I would expect to see the following (based on the sequence qty for each line):

Sequence NumberSequence QtyPacked Qty
11010
255
377
41111
552

<colgroup><col width="64" style="width:48pt" span="3"> </colgroup><tbody>
</tbody>
 
Upvote 0
starting / running packed quantitySequence Number
Sequence QtyPacked Qtyadditional packed quantityrunning unallocated packed quantityrow 3
3511010025row 4
25255020
20377013
13411111820
20552018
col acol bcol ccol dcol ecol f
the first 10 in packed quantity derived by
=IF(A4-C4>0,C4,A4-C4)
the first 25 in running unallocated packed quantity derived by
=A4-D4+E4

<colgroup><col><col><col><col><col><col><col span="5"></colgroup><tbody>
</tbody>
 
Upvote 0
starting / running packed quantitySequence Number
Sequence QtyPacked Qtyadditional packed quantityrunning unallocated packed quantityrow 3
3511010025row 4
25255020
20377013
13411111820
20552018
col acol bcol ccol dcol ecol f
the first 10 in packed quantity derived by
=IF(A4-C4>0,C4,A4-C4)
the first 25 in running unallocated packed quantity derived by
=A4-D4+E4

<colgroup><col><col><col><col><col><col><col span="3"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,763
Messages
6,132,582
Members
449,737
Latest member
naes

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