Thread: vba help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default vba help

assume 1 6 2 3 1 0 0 is in row 2 starting in A2, then in H2 put the formula

=if(sum(C2:G2)0,B2/Average(C2:G2),"--")

then drag fill down the column.

This doesn't produce your results, but uses the average demand per week.
You would have to show how you come up with you values. I get
5
3.333333
3.636364


--
Regards,
Tom Ogilvy

"Chris" wrote in message
...
Hello,

I am working on creating a Weeks of supply calc that would be a loop

within
VBA and I am hoping I can get some help here. Below is a sample table.

Item OH Wk1 Wk2 Wk3 Wk4 Wk5 WOS
1 6 2 3 1 0 0 ?
2 10 1 4 3 2 5 ?
3 8 1 2 4 3 1 ?


In the table above, I have the current OH for each of the items listed.

The
calculation for weeks of supply would be calculated in that the current

OH -
each number to its right until it hits 0. Example, item 1 would have 3

weeks
of supply. Item 2 would have 4 weeks of supply. Item 3 would have 3.3

weeks
of supply.

Any help on VBA for this would be greatly appreciated.

Chris