Subtracting until zero then taking remainder from another cell.

L

Legacy 414377

Guest
Hi all,

I am having a problem thinking of formula to calculate my wine stock with Excel 2013.

Here is an example:

Wine NameOpening StockBottlesTotalSalesClosing Stock
GlassBottleTotalReceivedGlassBottletotalGlassBottletotal
Wine 10.01.01.00.01.00.40.00.60.00.6
Wine 20.41.01.40.01.40.80.00.80.61.00.6

<tbody>
</tbody>


The problem comes from glasses and bottles being separate. 1 bottle = 5 glasses or 0.2. If we sell more glasses than we have in opening stock then we have to open a new bottle. I want closing stock to minus glass sales from opening glasses until it is zero, then take the remainder from a freshly opened bottle (worth 5 glasses); decreasing the closing bottle count when doing so and adding the remainder to glasses.

I hope this can be done its been driving me mad trying to figure this out and takes ages inputting these manually every time!

Thank you very much in advance
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Welcome to the MrExcel board!

Your second example doesn't make sense to me. Opening stock was 1.4, no purchases give a total still of 1.4. If glass sales were 0.8 how could there still be 1 full bottle left?

Anyway, see if these help.


Book1
BCDEFGHIJKL
1Op StockBottlesTotalSalesCl Stock
2GlassBottleTotalReceivedGlassBottleGlassBottletotal
3011010.40.600.6
40.411.401.40.800.600.6
50.411.434.41.610.811.8
Wine stock
Cell Formulas
RangeFormula
J3=F3-H3-G3-K3
K3=INT(F3-H3-G3)
L3=SUM(J3:K3)
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,039
Members
449,063
Latest member
ak94

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