+ Reply to Thread
Results 1 to 11 of 11

Formula for Inventory using one quantity in multiple locations

  1. #1
    Registered User
    Join Date
    08-02-2018
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    6

    Formula for Inventory using one quantity in multiple locations

    Hi,
    I have an inventory to try and determine how many RAW parts I need to order, FIN (parts made), WIP (parts available to be made), upcoming orders, RAW (same component in products a,b,c). I need a formula or function to take the FIN subtract the WIP and add the upcoming requirements to see how many raw parts are needed. But I need it to take into account if the number WIP has already been subtracted by one of the other components.

    So for example

    FIN
    a = 15
    b = 8
    c = 81

    WIP (part on hand to be divided and used in A,B,C)
    =54

    Upcoming orders
    a=20
    b=8
    c=437

    Raw Required
    a=0 (15 in fin, 5 from WIP)
    b= 0 (covered in FIN)
    c= 307 (81 from FIN, 49 from WIP)

    I'm not sure if I'm explaining this correctly, but for the RAW required C would need the formula to calculate the 81 in fin, subtract the 49 remaining in WIP realizing the 5 was taken for A.
    Attached Images Attached Images
    Last edited by shellymac; 08-03-2018 at 10:04 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,218

    Re: Formula for Inventory using one quantity in multiple locations

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-02-2018
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula for Inventory using one quantity in multiple locations

    Sorry,

    Here is the attachment.

    Thanks,
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula for Inventory using one quantity in multiple locations

    It would also be helpful if you could use the same details in your explaination as you have in your sample, it is not always obvious what is being referred to if the descriptions do not match the raw data provided.

    To make what you want work you will need to add an extra column to your table for a preliminary calculation.
    You will also need to UNMERGE the cells in column D and enter the colour into each individual cell. When you merge cells, only the top left cell of the merge range contains what you enter, the others are blank. So in your example, looking at the merged cell D2:D4, only D2 contains the word 'Black' D3 and D4 are empty, so the formula will not evaluate correctly.

    Whilst the merged cells in column D need to be removed, those in column E can be used to your advantage.

    Once you have unmerged the cells in column D and filled in the empty cells. Enter this formula into row 2 of your additional column.

    =MAX(0,K2-B2)

    Then use this formula in F2 to calculate the RAW parts needed. Note that the range G$2:G2 refers to the formula above, you will need to change that if you put that formula in a different column. Note that the $ symbol is only used in front of the first row.

    =ABS(MIN(0,LOOKUP(1E+100,E$2:E2)-SUMIF(D$2:D2,D2,G$2:G2)))

    Once entered, fill both formulas down as needed.

    edit:- this was based on your original screen image from post #1. looking at your sample file, I think that it might be incorrect.
    Last edited by jason.b75; 08-04-2018 at 09:58 AM.

  5. #5
    Registered User
    Join Date
    08-02-2018
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula for Inventory using one quantity in multiple locations

    Hi, Thanks for your response but still confused me. I have added a column and changed my sheet as you said. But the =MAX(0,K2-B2) threw me off.

    Please see my changed in the sample and maybe that will help understand what I'm trying to accomplish.

    Thanks,
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula for Inventory using one quantity in multiple locations

    I've changed the formula to remove the need for the extra column, but so that you can hopefully understand the logic a little better.
    The use of =MAX(0,K2-B2) or using descriptions, =MAX(0, 'customer order quantity' - 'FIN') tells you how many 'RAW' are required to satisfy that order. If 'FIN' is greater than the order quantity then you would get a negative result, so MAX(0 is used to eliminate the negatives.

    The new formula still uses the same logic, but it is applied by a different method. Please note that this is an array formula so must be confirmed by using Shift Ctrl Enter, not just enter.

    =ABS(MIN(0,LOOKUP(1E+100,E$2:E2)-SUM(IF(D$2:INDEX(D$2:D2,MATCH("zzz",D$2:D2))=LOOKUP("zzz",D$2:D2),--TEXT(G$2:G2-B$2:B2,"0;\0")))))

    However, this formula is still based on my original interpretation of your requirements, based on your answers to the following, it may or may not work as required.

    Could you explain what I'm missing with the expected result of 27 in I5?

    c=27 ((81 from FIN, 49(5 used in A) from WIP)) suggest an order quantity of 81 + 49 + 27 = 157, but the order quantity in that row is only 15

    Also, could you confirm that the cells in the WIP column are merged in your real file. The image that you provided in your first post shows merged cells, but your first sample file has merged cells in column D but not column E.

    I've added the formula to your file but you will need some consistency to your data structure to make it work properly. If the cells in the WIP column are not merged then the WIP quantity needs to be in the first row for each colour group.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-02-2018
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula for Inventory using one quantity in multiple locations

    Sorry I reversed my example it should have been 15 pcs in FIN and 81 pcs on order. Unfortunately the formula doesn't give me clear results. If you were to change the order quantities the formula doesn't work. I've changed the sample to create larger quantities for the BLACK example.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula for Inventory using one quantity in multiple locations

    The formula was returning incorrect results, but not in the way you thought. This version should work correctly.

    =MIN(ABS(MIN(0,LOOKUP(1E+100,E$2:E2)-SUM(IF(D$2:INDEX(D$2:D2,MATCH("zzz",D$2:D2))=LOOKUP("zzz",D$2:D2),--TEXT(G$2:G2-B$2:B2,"0;\0"))))),MAX(0,G2-B2))

    As before, this is an array formula so must be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    If you get 31, 0 and 131 for the first 3 results with this formula then that means that you have not confirmed the array.

  9. #9
    Registered User
    Join Date
    08-02-2018
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula for Inventory using one quantity in multiple locations

    Thank you for all your help! I have figured out how to properly confirm, but it seem now to be creating a sum so instead of having the A=31, B=50, C=185. I have A=31, B=81, C=266?
    Last edited by shellymac; 08-04-2018 at 01:06 PM.

  10. #10
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula for Inventory using one quantity in multiple locations

    It sounds like you've array confirmed the old formula, the one in post 8 returns 31, 50, 185.

  11. #11
    Registered User
    Join Date
    08-02-2018
    Location
    Ontario, Canada
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula for Inventory using one quantity in multiple locations

    Thank you so much!! This has been driving me crazy for days!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Inventory of equipment, but different locations
    By MrLomax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2017, 05:08 AM
  2. Deduct sales quantity from inventory
    By aglasier in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-01-2017, 12:39 PM
  3. [SOLVED] count the quantity in inventory
    By Mark-44 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-17-2016, 07:58 AM
  4. Replies: 3
    Last Post: 11-23-2015, 01:49 PM
  5. Counting Inventory Quantity formula help.
    By lorne17 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-24-2013, 01:57 PM
  6. [SOLVED] Inventory Planning - Help needed on replenishment quantity FORMULA
    By dev.jajati in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 05-24-2013, 01:07 PM
  7. [SOLVED] Updating inventory quantity
    By kuansheng in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-01-2006, 09:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1