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:

[TABLE="width: 878"]
<tbody>[TR]
[TD]Wine Name[/TD]
[TD="colspan: 3"]Opening Stock[/TD]
[TD]Bottles[/TD]
[TD]Total[/TD]
[TD="colspan: 3"]Sales[/TD]
[TD="colspan: 3"]Closing Stock[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Glass[/TD]
[TD]Bottle[/TD]
[TD]Total[/TD]
[TD]Received[/TD]
[TD][/TD]
[TD]Glass[/TD]
[TD]Bottle[/TD]
[TD]total[/TD]
[TD]Glass[/TD]
[TD]Bottle[/TD]
[TD]total[/TD]
[/TR]
[TR]
[TD]Wine 1[/TD]
[TD]0.0[/TD]
[TD]1.0[/TD]
[TD]1.0[/TD]
[TD]0.0[/TD]
[TD]1.0[/TD]
[TD]0.4[/TD]
[TD][/TD]
[TD]0.0[/TD]
[TD]0.6[/TD]
[TD]0.0[/TD]
[TD]0.6[/TD]
[/TR]
[TR]
[TD]Wine 2[/TD]
[TD]0.4[/TD]
[TD]1.0[/TD]
[TD]1.4[/TD]
[TD]0.0[/TD]
[TD]1.4[/TD]
[TD]0.8[/TD]
[TD]0.0[/TD]
[TD]0.8[/TD]
[TD]0.6[/TD]
[TD]1.0[/TD]
[TD]0.6[/TD]
[/TR]
</tbody>[/TABLE]


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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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