+ Reply to Thread
Results 1 to 7 of 7

Complex nested loop problem

  1. #1
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Complex nested loop problem

    The following spreadsheet contains two tabs Inventory and Forcast. The inventory tab contains the inventory levels of two types of parts the WU(where used) and the Raw parts, the WU is the # of finished assemblies utilizing the raw parts and are specific to the product specified(3K,4K,5K). Each WU also has a Usage amount which is the number of Raw Parts required to make one WU part. The WU inventories already have the usage taken into account( For example the 200 BBB parts were made using 2000 raw parts). In the forecast tab every product has an estimated number of production per year(Assume production is evenly distributed over the 12 months).

    My goal is to create a macro that can calculate the month(or year with decimals) when the inventory will run out. The WU inventory for each product will be used up first by the amount estimated in the forecast, once the WU is depleted for a certain product it will begin using the raw part inventory, this is where the usage for each part comes in to play (it takes 10 raw parts to makes one BBB for example).
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Complex nested loop problem

    I need some more explanation for once the WU is depleted for a certain product it will begin using the raw part inventory, this is where the usage for each part comes in to play (it takes 10 raw parts to makes one BBB for example). Is there are table or something that explains how many raw parts go into the making of a Part #.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Re: Complex nested loop problem

    Yes, column D in the inventory tab has the Usage # for each part, which is the number of raw parts needed to make 1 WU part( 10,2,4 respectively for BBB, CCC, DDD)

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Complex nested loop problem

    Let me see if I understand now. You have 200 part BBB in stock now. When you use these up, you can draw 10 Part AAA and make one part BBB.

    Let me run through an example for part BBB. You have 200 in stock. These will last you until about part way through 2020. At that point we are 50 units short of meeting the forecast, so I need to take 50 * 10 AAA out of stock to make up for the shortage. Assuming that I have not already depleted AAA to make up shortages elsewhere. Is this correct?

  5. #5
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Re: Complex nested loop problem

    Yes that's correct, thanks for helping

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Complex nested loop problem

    Don't thank me yet; I'm still trying to figure out how to tackle this one. But that's why I take these things on. Occasionally I have to look up something on the Excel side and learn something new, but mostly I use these as brain teasers to keep the old noggin healthy.

    P.S. A long, long time ago, I used to live down the road from you in Chelmsford. I was stationed at the base in Bedford.

  7. #7
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Re: Complex nested loop problem

    Oh really, Im actually in Bedford working at the former site of Raytheon

+ 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. Nested loop problem
    By gibbsa08 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2016, 04:45 PM
  2. Problem with vba copy find nested loop
    By Anna_P in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-20-2014, 09:08 AM
  3. nested loop problem
    By mcousin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-07-2014, 02:39 PM
  4. [SOLVED] Having problem with a nested FOR loop
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-03-2014, 04:39 AM
  5. Nested Loop problem/Algorithm
    By Asad74 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2012, 09:36 PM
  6. For each loop nested; getting stuck on one cell in first iteration of nested loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2009, 11:54 AM
  7. Complex nested array formula problem and challenge
    By PeterWilliams in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2007, 10:34 PM

Tags for this Thread

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