Inventory Level (days) based on actual pull-out

Jonasaur

New Member
Joined
Dec 17, 2018
Messages
2

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi Jonasaur,

that was a tough nut to crack... Something that seems so obvious for us humans is pretty hard to catch in a simple excel formula. In the end I ended up comparing it to cash flows: say you invest 100 now and get back 20 in year 1, 40 in year 2, etc. In how many years would you get back your investment? That got me to e.g. this site: https://techtites.com/calculating-payback-period-in-excel/
As you see, they use a lot of extra formulas to get to this one number (days of stock left in your case).
There are luckily some people who came up with a monster formula, see: https://www.reddit.com/r/excel/comments/55cumo/elegant_method_for_calculating_payback_and/
The file there: http://upload.jetsam.org/documents/Payback Period.xlsx (the initial amount is in C7, the yearly amounts in D7:H7)
And the solution:
Code:
=IF(SUM(D7:H7,C7)<0,"Never",SUMPRODUCT(CHOOSE(SIGN(INT((MMULT(D7:H7*((COLUMN(D7:H7)<=TRANSPOSE(COLUMN(D7:H7)))),--TRANSPOSE(D7:H7=D7:H7))+C7)/IFERROR(1/(1/ABS(TRANSPOSE(D7:H7))),1)))+2,1,1-((MMULT(D7:H7*((COLUMN(D7:H7)<=TRANSPOSE(COLUMN(D7:H7)))),--TRANSPOSE(D7:H7=D7:H7))+C7)/TRANSPOSE(D7:H7)),0)))
Note: it's an array formula, needs CTRL+SHIFT+ENTER to work.
Having said that, you probably do want to re-order your data so you have all your consumption in one block (maybe on another sheet or at the end of the row), not the format you have currently. Another option might be to create a VBA function.

Good luck,

Koen
 
Upvote 0
Hi Koen!

Thanks for the feedback!

Can it be applied given the structure of the template I shared? I am also considering to add another worksheet as helper but it would be hard to maintain when I am not around.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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