LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default UDF weeks of inventory calculation - lost on how to create this lo

Hello all, I am trying to create a function to calculate the weeks of
inventory based on future sales, actuals for historical and forecast for
future.

I can create a row in the excel report that will show actuals through the
latest reported week and forecast, so the function can use the same row of
data for sales.

My goal is to create a true weeks of inventory calculation, not based on the
inventory divided by the average sales over a time period, but how many weeks
it would take to deplete the inventory reported based on actual sales or
forecast.

For the first product, the inventory is in row 21, first weeks reported
starting in column G, and the sales data is in row 17.

If the inventory of the first week to calculate is in G21, then I would want
to begin the weeks of inventory calculation using the sales starting in the
following week, cell H17

My thought of how this would work would be a loop that counts how many weeks
the sum of 100% of those weeks sales is less than the inventory.

Example would be in week of 12/30/07, the inventory reported was 4,573. The
sales in the next week, 1/6/08 = 548, 1/13/08 = 407, 1/20/08 = 503, 1/27/08 =
617, 2/3/08 = 575, 2/10/08 = 444, 2/17/08 = 515, 2/24/08 = 478, 3/2/08 = 483.

There fore, if the loop was functioning as I envision it, the count of the
loop would be 9, and since these weeks only add up to 4,570, there would be a
balance of 3 left to decrement from the inventory.

The next step in the function would take the balance and divide it into the
sales of week 3/9/08, which are 250. This is equal to 0.012.

At the end of this step, the function would add to loop count and the last
step together to calculate the actual weeks of inventory to be 9.012.

Thank you for taking the time to read the narrative above. Here is the
function I have written so far. I am confident that if I was aided in the
first step of the loop, I could complete the function. Any and all help is
greatly appreciated.

Public Function WKSINVsim02(ByVal invST As Single) As Single
Dim invLP As Integer, invINC As Single, posCL As Integer

''invST is starting inventory quantity
''invLP is counter
''invINC is inventory loop quantity
''posCL is pos cell in loop

invLP = 0
invINC = 0
posCL = invST.Offset(-4, 0).Value

Do While invINC < invST
invINC = invINC + posCL
invLP = invLP + 1
posCL = cell.posCL.Offset(0, 1).Value
Loop

WKSINVsim02 = invLP

End Function
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weeks of Supply Calculation Rob Williamson PSU[_2_] Excel Worksheet Functions 1 October 2nd 09 12:43 PM
Create Calculation to return number of weeks and days Lisa D Excel Worksheet Functions 8 December 30th 08 05:22 PM
Impact of negative sales on inventory weeks on hand DHallgren Excel Discussion (Misc queries) 4 February 15th 07 02:57 PM
return calculation every four weeks [email protected] Excel Discussion (Misc queries) 1 May 11th 06 12:15 PM
Weeks of Supply Calculation Langrbj Excel Discussion (Misc queries) 4 March 12th 06 05:46 PM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"