Select available lot number and assign to order based on quantity

maggieo

New Member
Joined
Jun 16, 2015
Messages
1
Hello,
I have been tasked at the company I work for with keeping an eye out on our orders to be filled in the short term compared to our inventory level, in order to alert customers of delays as a temporary solution while a better software is implemented.


To do this, I have a list of orders we need to fill in the next 3 weeks with product code and quantity (~1200 lines of data), and I have a list of our inventory which includes product code, quantity and batch number. Here's a sample of the two sets of data that I have to work with : Dopbox link to image

That would be simple enough if it weren't for the fact that because of the nature of our business, we can't use multiple lots of the same product to fill one order. So if I have an order for product XYZ quantity of 100, and I have 200 in stock split the following way:



  • Lot A - Quantity 50
  • Lot B - Quantity 50
  • Lot C - Quantity 100
I would HAVE to use Lot C, as our customers would not accept to have their order filled from more than one lot.


To explain what I'm trying to achieve, this is how I'm doing it manually today:

  1. On order sheet: Look at order line quantity
  2. On stock sheet: Find product, look for first available lot with order quantity or more. Copy lot number
  3. On order sheet: Paste lot number to order line (this will re-calculate stock quantity on stock sheet, based on a SUMIF formula)


<code style="font-family: "Courier New", courier, monospace; margin: 0px 2px; padding: 15px; border: 0px; background-color: transparent; border-radius: 2px; word-break: normal; display: block; font-size: 1em; line-height: 16px; overflow: auto;">=J2-SUMIF(A:A,I2,E:E)
</code>
On column A, I currently have the following formula:

=IF(VLOOKUP(B2,H2:K11,3,FALSE)>E2,VLOOKUP(B2,H2:K11,2,FALSE),"REVIEW")

This helps in looking at the first lot of product and if there's enough in it to fill the order, it selects that lot for the order. The problem is that I don't know how to force it to continue to look at other available lots if the first one does not have the required quantities. Using a nested if formula is not possible as some products could have as much as 50 different lots with different quantities.


Any help or guidance will be greatly appreciated!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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