Calculating current cover based on forward requirements...

Matty

Well-known Member
Joined
Feb 17, 2007
Messages
3,717
Hello All,

This should be fairly straight forward, but I'm struggling to construct a formula to give me the result I want.

I have drawn up a simple summary to show what I am trying to achieve:
Book1
ABCDEFGHIJK
1Week1Week2Week3Week4Week5Week6Week7Week8Week9Week10
2Demand101512816201315725
3Production02500250250250
4Stock352535231524416119
5Cover(Days)??????????
Sheet1


I want to calculate how much cover, in days, the current Stock position gives me, based on the forward Demand that exists. If the days cover is actually negative, the formula should treat it as such.

I'd greatly appreciate any suggestions people have got.

Thanks,

Matty
 
Awesome solution 12 years ago to this real-life problem of calculating stock coverage! Works correctly even with 0 weeks.

The issue is the OFFSET which is volatile.

Anyone who is able to change OFFSET TO INDEX?

I tried replacing it with INDEX construction

B2:INDEX(B2:$K2,,COLUMN(B2:$K2)-COLUMN(B2)+1)

But INDEX doesn't accept an array for [column num].

I tried solutions based on:
https://excelxor.com/2014/09/05/index-returning-an-array-of-values/
https://stackoverflow.com/questions/47187863/can-excels-index-function-return-array

Using the coercion

B2:INDEX(B2:$K2,,N(IF({1}, COLUMN(B2:$K2)-COLUMN(B2)+1)))

But this doesn't work either. Based on evaluate formula, INDEX then returns an array of values, not an array of references, and then generates #VALUE ! error when combined with the : operator.

Any ideas?
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Non-volatile solved! (y)

I managed to design a calculation that delivered the same result as Dominic's very clever but volatile solution from 2007.

Downside is that three helper rows/columns are needed.

1. Cumulative Demand (ascending running total of the demand)
2. Weeks Full Coverage (array formula using MATCH that searches cumulative demand to find the week when the current stock doesn't fully cover demand anymore)
3. Week Partial Coverage (non-array formula using [cell]:INDEX[cell] dynamic range construction to find the residual stock for the partially covered week and calculate the partial coverage of that week).

Total Coverage Weeks = Weeks Full Coverage + Week Partial Coverage

I have a spreadsheet comparing the different calculations. I get the same result with the original input data.

If anyone is truly interested, please let me know and i'll post it. I'm also subscribing to this thread.
 
Upvote 0

Forum statistics

Threads
1,215,561
Messages
6,125,542
Members
449,236
Latest member
Afua

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top