Forecast shortages

BrutalDawg

New Member
Joined
Jun 10, 2015
Messages
41
Hello,

I am trying to be able to better identify shortages without as many steps for other users that are not as fluent in excel. Currently, all I do is take my sales order filter down to 3-4 weeks and run a combination script:

Sub CombineRows()
'Updated 20150511
Dim WorkRng As Range
Dim Dic As Variant
Dim arr As Variant
On Error Resume Next
xTitleId = "Stock-INSERT-DATE-HERE"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Set Dic = CreateObject("Scripting.Dictionary")
arr = WorkRng.Value
For i = 1 To UBound(arr, 1)
Dic(arr(i, 1)) = Dic(arr(i, 1)) + arr(i, 2)
Next
Application.ScreenUpdating = False
WorkRng.ClearContents
WorkRng.Range("A1").Resize(Dic.Count, 1) = Application.WorksheetFunction.Transpose(Dic.keys)
WorkRng.Range("B1").Resize(Dic.Count, 1) = Application.WorksheetFunction.Transpose(Dic.items)
Application.ScreenUpdating = True
End Sub

Then I utilize a simple conditional formatting rule that highlights any item that is less than Stock. This creates a lot of leg work of verifying when the PO will deliver compared to the sales order. I am trying to develop a tool, where I can have the Sales Orders on Sheet1, Stock on Sheet2, and better identification of shortages. For example stock:

Item NumberQuantity
1a1200
2b2305

<tbody>
</tbody>


Example Sales Orders:
LocationPurchaseOrderNumberPart NumberTimingQuantityWhen
8001a1Planning5011/1/2016
7201a1Planning5011/1/2016
8002b2Planning10011/1/2016
80A437B1a1Planning5011/8/2016
72A8683B1a1Planning10011/8/2016
72A8932b2Planning5011/8/2016
6501a1Planning7511/15/2016
8002b2Planning7511/15/2016
65A437B2b2Planning10011/15/2016
80A78932b2Planning12011/22/2016
65B78201a1Planning10011/22/2016

<tbody>
</tbody>

with an example output of:
LocationPurchaseOrderNumberPart NumberTimingQuantityWhenShort Quantity
8001a1Planning5011/1/2016
7201a1Planning5011/1/2016
8002b2Planning10011/1/2016
80A437B1a1Planning5011/8/2016
72A8683B1a1Planning10011/8/201650
72A8932b2Planning5011/8/2016
6501a1Planning7511/15/20160
8002b2Planning7511/15/2016
65A437B2b2Planning10011/15/201620
80A78932b2Planning12011/22/20160
65B78201a1Planning10011/22/20160

<tbody>
</tbody>

Is this possible with the SO's having split quantities?

Thanks for any suggestions!
 
Formulas accounting for optional -exact suffixes on Stock

Short Qty
=IF(VLOOKUP(C2&"*",Sheet2!A:B,2,0)< SUMIF($C$1:C2,C2,$E$1:E2),SUMIF($C$1:C2,C2,$E$1:E2)-VLOOKUP(C2&"*",Sheet2!A:B,2,0),"")

Rolling Stock
=VLOOKUP(C2&"*",Sheet2!A:B,2,0)-SUMIF($C$1:C2,C2,$E$1:E2)


Note: if you use the rolling stock formula, the Short Qty formula could be
=IF(H2<0,ABS(H2),"")
 
Last edited:
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,215,268
Messages
6,123,975
Members
449,137
Latest member
yeti1016

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