Variable sum formula

DanKokoro

New Member
Joined
Dec 14, 2009
Messages
27
Hi all,

Didn't really know what to call this thread, as i don't even know what it is i am after. But i will do my best to explain.

I work in FMCG and i am after a formula that will tell me how long my stock on hand of a particular product will last based on forecasted sales.

I have a data table that has forecasted sales by item by month.

In column A starting at A3 i have my products listed, e.g. A3 = "Cheese", A4 = "*******s", A5 = "Biscuits".

In row 2 starting at B2 i have the months of the year, e.g. B2 = "January", B3 = "February" etc.

In cell A1 and A2 are my variables. A1 is the product name, and A2 is the stock on hand.

What i am after is a formula that will look up the product name, and then sum the forecasted sales, starting with January, until it exceeds the stock on hand (A2), and then return the month in which that occurs.

So for example. A1 = "*******s" and A2 = 100 (units).
Forecast for *******s is January=50, February=30, March =30, April =20.

I want the formula to return "March", because according to my forecasts, it is in March that i will run out of *******s (50+30+30 exceeds 100)..

This would make my job 100 times easier so i'd really appreciate some help on this one!! thanks very much in advance folks!

I apologise if this could have been explained better...
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi all,

Didn't really know what to call this thread, as i don't even know what it is i am after. But i will do my best to explain.

I work in FMCG and i am after a formula that will tell me how long my stock on hand of a particular product will last based on forecasted sales.

I have a data table that has forecasted sales by item by month.

In column A starting at A3 i have my products listed, e.g. A3 = "Cheese", A4 = "*******s", A5 = "Biscuits".

In row 2 starting at B2 i have the months of the year, e.g. B2 = "January", B3 = "February" etc.

In cell A1 and A2 are my variables. A1 is the product name, and A2 is the stock on hand.

What i am after is a formula that will look up the product name, and then sum the forecasted sales, starting with January, until it exceeds the stock on hand (A2), and then return the month in which that occurs.

So for example. A1 = "*******s" and A2 = 100 (units).
Forecast for *******s is January=50, February=30, March =30, April =20.

I want the formula to return "March", because according to my forecasts, it is in March that i will run out of *******s (50+30+30 exceeds 100)..

This would make my job 100 times easier so i'd really appreciate some help on this one!! thanks very much in advance folks!

I apologise if this could have been explained better...
Try this...

Book1
ABCDEFGHIJKLM
1Prod3____________
2455JanFebMarAprMayJunJulAugSepOctNovDec
3Prod1927750754421101642721449
4Prod299958439385854656677182
5Prod3878385561850664781366978
Sheet1

This array formula**:

=INDEX(B2:M2,MATCH(TRUE,SUBTOTAL(9,OFFSET(B3,MATCH(A1,A3:A5,0)-1,,,COLUMN(B3:M3)-COLUMN(B3)+1))>=A2,0))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

For Prod3, the current inventory of 455 will run out in Aug.
 
Upvote 0
that probably would have only taken me 2 lifetimes to figure out by myself.. worked perfectly.. thanks so much!
 
Upvote 0
You have already received a solution but here's a UI tip. You can dramatically improve the UI and improve the usability of your worksheet by using columns B and C to store the inventory on hand and the calculated month when stock will run out. Now, you can see the results for *all* your products at the same time!
Hi all,

Didn't really know what to call this thread, as i don't even know what it is i am after. But i will do my best to explain.

I work in FMCG and i am after a formula that will tell me how long my stock on hand of a particular product will last based on forecasted sales.

I have a data table that has forecasted sales by item by month.

In column A starting at A3 i have my products listed, e.g. A3 = "Cheese", A4 = "*******s", A5 = "Biscuits".

In row 2 starting at B2 i have the months of the year, e.g. B2 = "January", B3 = "February" etc.

In cell A1 and A2 are my variables. A1 is the product name, and A2 is the stock on hand.

What i am after is a formula that will look up the product name, and then sum the forecasted sales, starting with January, until it exceeds the stock on hand (A2), and then return the month in which that occurs.

So for example. A1 = "*******s" and A2 = 100 (units).
Forecast for *******s is January=50, February=30, March =30, April =20.

I want the formula to return "March", because according to my forecasts, it is in March that i will run out of *******s (50+30+30 exceeds 100)..

This would make my job 100 times easier so i'd really appreciate some help on this one!! thanks very much in advance folks!

I apologise if this could have been explained better...
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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