Hello.
Sample Data is attached.
I have a fun problem to solve regarding inventory at specific warehouses. Each warehouse should have x inventory referred to as "Inventory Needed". Some warehouses have inventory above this level ("Excess") while other warehouses have inventory less than what is needed ("Need"). The inventory of each "Product" on hand at each warehouse is referred to as "Total Inventory Available".
Warehouse Name Product Inventory Needed Total Inventory Available Excess Need Orange Drive 406200 3 0 0 3 Purple Blvd. 406200 6 7 1 0 Green Street 407969 4 5 1 0 Yellow Blvd. 407969 9 12 3 0 Blue Street 414017 3 0 0 3 Green Street 414017 5 3 0 2 Orange Drive 414017 5 8 3 0 Orange Drive 443029 7 8 1 0 Red Street 443029 4 2 0 2 Blue Street 454392 6 9 3 0 Orange Drive 454392 5 5 0 0 Red Street 476585 10 10 0 0 Blue Street 478624 4 3 0 1 Red Street 478624 7 8 1 0
I would like to begin writing some code to that would loop through each warehouse and identify if there is any excess units of that product at a different warehouse that can be moved to fill any inventory needs. The end result would be a print out of each inventory transfer that needs to occur in order to redistribute including the name of the sending warehouse, the product, quantity being transferred, and the receiving warehouse.
Sending Warehouse Product Quantity Receiving Warehouse Purple Blvd. 406200 1 Orange Drive Orange Drive 414017 3 Blue Street Orange Drive 443029 1 Red Street Red Street 478624 1 Blue Street
I have attempted to achieve this result using some fun and fancy rolling formulas involving waaaay too many columns. It worked-ish with the biggest issue being my output including the redistribution of the same inventory to multiple different warehouses.
I did my best to search for a thread that covered my request, but could not find anything. Does anyone have any code that I can explore? Or a link to a similar thread or topic you find online? I'm certain I'm not finding any results because of poor wording on my part.
Thank you in advance!
Bookmarks