Formula needed to calculate inventory

RSDB

New Member
Joined
Jun 9, 2020
Messages
11
Office Version
  1. 365
Platform
  1. MacOS
Is there a formula that will deduct an amount from a total in one column but when it reaches zero, the remaining amount gets deducted from another column so that there is not a negative amount showing. For example. There are 3 items left from the first stock order (column 1) and 20 items left from a the second stock order (column 2). A client as for delivery of 10 pieces of the item. 3 out of the 10 pieces get deducted from the first stock order, bringing the total to zero, no more stock left (column 1) and the remaining 7 items get deducted from the second stock order (column 2).
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Welcome to the Board! Yes, you could determine the apportionment between columns several ways. Here is one example using SUBTOTAL, SUM, and MIN functions to draw some "total to deduct" from 3 columns. You can copy this entire example to your clipboard by clicking on the clipboard icon in the upper left (near intersection of row and column headers) and then pasting into a practice sheet in cell A1 of your workbook. Enter some value in B1 and the formula will apportion that amount between columns so as to not exceed the sum of that column.
Book2
ABCD
1Total to deduct23
2Apportionment1850
3
4Inventory
5sum below -->18156
6col1col2col3
7332
8454
957
106
11
Sheet2
Cell Formulas
RangeFormula
B2B2=MIN($B$1,B$5)
C2:D2C2=MIN($B$1-SUM($B2:B2),C$5)
B5:D5B5=SUBTOTAL(9,B7:B14)
 
Upvote 0
Thank you for your reply and your time. I have attached a screenshot of my worksheet. We delivered 6 items (I8), we had 10pcs in stock (D8) from two combined orders (B8+C8). The first image show with my current formula which is just a normal =I8-D8 calculation shows after 6pcs was delivered a negative amount. Im looking for a formula that will give me an answer as seen in the second image. J8=0, K8=4.


1591717107152.png


1591717137989.png
 
Upvote 0
What do the rows represent? Your example discusses row 8. Is row 9 for an entirely different item or is it related to row 8 somehow?
 
Upvote 0
You can adapt my earlier example like this, assuming the rows are independent:
Book2
ABCDEFG
1SO1SO2Inventory SumDeliveryInventory SO1Inventory SO2
2
3
4
5
6
7
85510651
93554038353
10371350473710
Sheet3
Cell Formulas
RangeFormula
F8:F10F8=MIN($E8,B8)
G8:G10G8=MIN($E8-SUM($F8:F8),C8)
D8:D10D8=SUM(B8:C8)
 
Upvote 0
Yes each row is independent. Are there a way that it can show the remaining stock rather then what stock has been delivered. Referring to your F8 and G8.
 
Upvote 0
Try something like this:
Book2
ABCDEFG
1SO1SO2Inventory SumDeliveryInventory SO1Inventory SO2
2
3
4
5
6
7
85510703
9355403802
1037135035213
Sheet3
Cell Formulas
RangeFormula
F8:F10F8=B8-MIN($E8,B8)
G8:G10G8=C8-MIN($E8-(B8-F8),C8)
D8:D10D8=SUM(B8:C8)
 
Upvote 0
You are amazing. Thanks. I'll give this a try.
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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