Allocate Stock from Purchase order to Sales order

FerryG

New Member
Joined
Jun 1, 2016
Messages
1
Dear All

I'm having difficulty achieving the following,

We have a chronological list with Items, purchase orders and sales orders.
I want to know which purchase order is the latest one needed to cover the quantity in the sales order. (this is not always the first purchase order that comes next)

In column G I've put the desired output, could someone give me a push in the right direction?

Many thanks for your help!


Book1
ABCDEFG
1Item CodeDesired DateOrder TypeOrder number/StockQuantityNew Stock LevelDesired output
2Item AStart StockIn stock00
3Item A1-5-2016Purchase orderPO 155
4Item A16-5-2016Sales OrderSO 1-50PO 1
5Item A25-5-2016Sales OrderSO 2-3-3PO 2
6Item A26-5-2016Sales OrderSO 3-3-6PO 2
7Item A31-5-2016Sales OrderSO 4-5-11PO 3
8Item A1-6-2016Purchase orderPO 26-5
9Item A5-6-2016Purchase orderPO 361
10Item A20-6-2016Sales OrderSO 5-3-2PO 4
11Item A30-6-2016Sales OrderSO 6-3-5To be ordered
12Item A23-6-2016Purchase orderPO 42-3
13Item BStart StockIn stock55
14Item B1-5-2016Purchase orderPO 5510
15Item B16-5-2016Sales OrderSO 7-55In stock
16Item B25-5-2016Sales OrderSO 8-32PO 5
17Item B26-5-2016Sales OrderSO 9-3-1PO 6
18Item B31-5-2016Sales OrderSO 10-5-6PO 6
19Item B1-6-2016Purchase orderPO 660
20Item B5-6-2016Purchase orderPO 766
21Item B20-6-2016Sales OrderSO 11-33PO 7
22Item B30-6-2016Sales OrderSO 12-30PO 7
23Item B23-6-2016Purchase orderPO 822
Sheet1
 

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.

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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