Formula for inventory scenario

leohothunk

New Member
Joined
Jan 3, 2019
Messages
6
Need guidance with formula for inventory scenario

Hi Team,

Need your expertise with one formula...

Scenario -
I have 1700 no of boxes.
each box has 12 packs/pieces inside.
If I sold 75.4 (sometimes the boxes and decimal number will different as per the order)
balance should be 1624.8 its by manually

Need an formula for this scenario to keep maintain the inventory.

Excel table - (below calculation is as per manual)
ColumnA - No of Boxes are 1700
ColumnB - No of Boxes sold are 75.4
ColumnC - Balance boxes 1624.8



Thanks
Leo
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Welcome to the Board!

Isn't it just putting a formula in column C that subtracts column B from column A?, i.e.
Code:
=A2-B2

Or is there more to it than that, that you haven't told us about yet?

If the issue is that you want the previous rows ending value (column C) to be the new current rows starting value, then just place this in cell A3:
Code:
=C2
and copy the formulas in column A and C down for all your rows.
 
Last edited:
Upvote 0
Joe, I think the OP is looking to take in to account the 12 pieces per box. 1700-75.4 would be 1624.6, not the 1624.8 they are expecting. I don't have time to work through it just pointing it out is all.
 
Upvote 0
Joe, I think the OP is looking to take in to account the 12 pieces per box. 1700-75.4 would be 1624.6, not the 1624.8 they are expecting. I don't have time to work through it just pointing it out is all.
If that is the case, then it appears that the decimal part of the number really isn't a decimal at all, but rather a number between 1 and 11, representing the fractional part of the box (12ths).
Is that correct, Leo?

If so, any chance we can use some "helper" columns (we can always hide them)?
Otherwise, the formula might get to be a bit messy.
 
Last edited:
Upvote 0
If that is the case, then it appears that the decimal part of the number really isn't a decimal at all, but rather a number between 1 and 11, representing the fractional part of the box (12ths).
Is that correct, Leo?

If so, any chance we can use some "helper" columns (we can always hide them)?
Otherwise, the formula might get to be a bit messy.


Hi Joe4,

Yes correct, decimal is nothing but number between 1 and 12...

Scenario or example -
Monday -
One customer asks me to deliver the 32 cookie boxes and 4 cookie packs

Tuesday -
Another customer asks me to deliver the 26 cookie boxes and 2 cookie packs

Tuesday evening or Wednesday -
When I calculate or maintain the inventory in excel, I should get the sold boxes as 32+26=58 boxes and 4+2=6 packs
Take as I was having a stock of 100 cookie boxes... (in one box there are 12 cookie packs) so with above scenario inventory balance should be 41 boxes + 6 packs.

Hope you got my query

Thanks
Aarif
 
Upvote 0
Can you answer my last questions here?
If so, any chance we can use some "helper" columns (we can always hide them)?
Otherwise, the formula might get to be a bit messy.
Otherwise, I am going to give you a huge monstrosity of a formula that may scare you!
 
Upvote 0
If your starting value was in cell A2 and the boxes sold were in B2, here is what the formula I came up with to put in C2 would look like:
Code:
=VALUE(INT(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10)))/12)&"."&MOD(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10))),12))
Using "helper" columns, I would convert the numbers in columns A and B to the number of "packs", like this:

Column A packs (put in cell E2):
Code:
=INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10)

Column B packs (put in cell F2):
Code:
=INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10)

Total difference in packs (put in cell G2):
Code:
=E2-F2

Convert difference to boxes (put in cell C2):
Code:
=VALUE(INT(G2/12) & "." & MOD(G2,12))

You can then elect to hide columns E, F, and G if you like (no need to display them).
 
Last edited:
Upvote 0
If your starting value was in cell A2 and the boxes sold were in B2, here is what the formula I came up with to put in C2 would look like:
Code:
=VALUE(INT(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10)))/12)&"."&MOD(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10))),12))
Using "helper" columns, I would convert the numbers in columns A and B to the number of "packs", like this:

Column A packs (put in cell E2):
Code:
=INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10)

Column B packs (put in cell F2):
Code:
=INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10)

Total difference in packs (put in cell G2):
Code:
=E2-F2

Convert difference to boxes (put in cell C2):
Code:
=VALUE(INT(G2/12) & "." & MOD(G2,12))

You can then elect to hide columns E, F, and G if you like (no need to display them).


Hi Joe4,
I do not have any words to say...
I mean, am not sure how to thank you... :)
with the first formula I'm able to get the right balance

Code:
[COLOR=#333333]=VALUE(INT(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10)))/12)&"."&MOD(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10))),12))[/COLOR]

Thank you very much sir...

Checking for the rest of the formulas, will confirm you soon.

Thanks
Leo
 
Upvote 0
You are welcome.

The other formulas do the same thing as the first formula, it is just broken up into smaller bits, which makes it a little easier to maintain, if you have need to modify the formulas at all.
 
Upvote 0
Hi,

I'm sorry, but I find that the formula you're choosing is providing incorrect results for my sample below, row D6 and D14.

Try my formula in C2:


Book1
ABCD
1InventorySoldMy FormulaJoe4's Formula
21700.075.41624.81624.8
3170075.111624.11624.1
4170075.41624.81624.8
5170075.11624.111624.11
6170075.21624.101624.1
7170075.31624.91624.9
8170075.41624.81624.8
9170075.51624.71624.7
10170075.61624.61624.6
11170075.71624.51624.5
12170075.81624.41624.4
13170075.91624.31624.3
14170075.101624.21624.11
15170075.111624.11624.1
16170075.01625.01625
171700.475.41625.01625
181700.4751625.41625.4
Sheet444
Cell Formulas
RangeFormula
C2=INT((INT(A2)*12+IFERROR(MID(A2,FIND(".",A2)+1,2),0)-(INT(B2)*12+IFERROR(MID(B2,FIND(".",B2)+1,2),0)))/12)&"."&ROUND(MOD((INT(A2)*12+IFERROR(MID(A2,FIND(".",A2)+1,2),0)-(INT(B2)*12+IFERROR(MID(B2,FIND(".",B2)+1,2),0)))/12,1)*12,0)
D2=VALUE(INT(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10)))/12)&"."&MOD(((INT(A2)*12+IF(ROUND(A2-INT(A2),2)=0.11,11,ROUND(A2-INT(A2),1)*10))-(INT(B2)*12+IF(ROUND(B2-INT(B2),2)=0.11,11,ROUND(B2-INT(B2),1)*10))),12))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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