Complex Excel lookup formula

Posted on 2011-05-02
Last Modified: 2012-05-11
Lets say I run 3 stores plus a Distribution Centre (DC). Whenever a customer orders inventory at each store, I want to update that store's remaining inventory.  Also, if the customer orders more inventory than what the store has in stock, then i want the formula to reduce the inventory from the DC instead.  

Here is my scenarios for this example: (note: I only used 4 customers in this example, but i need the formula to have the ability to deal with several more than this).

Store1 Inventory: 200
Store2 Inventory: 200
Store3 Inventory: 200

Distribution Centre (DC) Inventory: 1000

Store1_Customer1 buys 150 items, so I need to reduce Store1 inventory down to 50.  Since there is stock remaining at the store, I do not need to draw down stock at the Distribution Center (DC) at this time.

Store2_Customer2 buys 250 itmes from store2, so I need to reduce Store2 inventory down to 0 items, and reduce the DC inventory down by 50 from 1000 to 950.

Store2_Customer3 buys 100 itmes from store2, since there is 0 inventory remaining at Store2 I need to reduce the DC inventory down by 100 items from 950 to 850.

Store3_Customer4 buys 250 items from store3, so I need to reduce this store's inventory down to 0, and reduce the DC inventory by 50, from 850 to 800.

I attached a screen print of my worksheet to give you an idea of the layout.
Note:  The yellow-highlighted area is where I need the formulas to update the remaining inventories.


Question by:jtencha
    LVL 22

    Accepted Solution

    See attached file. I've added two 'helper' colums. 'Total needed' and 'From DC'. With these extra columns there is no need for complex formula's.
    LVL 6

    Expert Comment

    Please review the worksheet.
    LVL 6

    Expert Comment

    Please review the screen shot. I use sumif to find out the order for each store. I check if the store order is greater than the store inventory. If the store order is greater than the store inventory, the store inventory goes to 0 and DC invenotry will be reduce by the extra order.
    LVL 6

    Assisted Solution

    You can do this with some formulas and extra columns. But maybe not efficient whenthat you can expand the sheet with lots of clients and products.

    See here result and formulas

    Alternative , itcan be done though is that for every customer added to the list, a macro is run that does the calculation and updates the yellow fields

    Author Closing Comment

    Thanks for the help.  I think these formulas will work.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
    Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
    The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now