Monitoring Batchwise Expire Stock, Need Formula in Excel

rajendradk9

New Member
Joined
Aug 3, 2013
Messages
39
Hi,

Need formula to monitor/track expire stock batchwise, Having data from Column A to F, based on this need to know in G column Expire qty from respective batch

ABCDEFG
ProductBATCHExpiryConsumption Start DateMonthly ConsumptionBatchwise StockExpire STK From Perticular Batch
Chemical-ABATCHA1
31-Jan-23​
01-Dec-22​
103010
Chemical-ABATCHA2
28-Feb-23​
01-Dec-22​
1050
Chemical-ABATCHA3
31-Mar-23​
01-Dec-22​
1050
Chemical-ABATCHA4
30-Apr-23​
01-Dec-22​
106040
Chemical-BBATCHB1
31-Jan-23​
01-Dec-22​
30200
Chemical-BBATCHB2
28-Feb-23​
01-Dec-22​
3010030
Chemical-BBATCHB3
31-Mar-23​
01-Dec-22​
3010040
Chemical-BBATCHB4
30-Apr-23​
01-Dec-22​
305050
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I get that you end up with 10 stock expire BATCHA1 (30 stock, use 10 in December and January, end up with 10 expired), but how do you end up with 40 expired in BATCHA4? Shouldn't that be 10 as well?
 
Upvote 0
Hi, see the linked file (with 15 auxiliary columns) for a possible solution...

The formulas used in the table:
H2: =F2-Q2-S2-V2
I2: =ROUND((DAY(D2)-1)/DAY(EOMONTH(D2,0)),6)
J2: =(YEAR(C2)-YEAR(D2))*12+MONTH(C2)-MONTH(D2)-1
K2: =ROUND((DAY(EOMONTH(C2,0))-DAY(C2))/DAY(EOMONTH(C2,0)),6)
L2: =J2+2-I2-K2
M2: =YEAR(D2)&"#"&RIGHT("0"&MONTH(D2),2)&"#"&I2
N2: =YEAR(C2)&"#"&RIGHT("0"&MONTH(C2),2)&"#"&(1-K2)
O2: =IF(A2=A1,IF(AND(W1>=M2,W1<=N2),1-T1,IF(W1<M2,I2,"")),I2)
P2: =IF(A2=A1,IF(AND(W1>=M2,W1<=N2),W1,IF(W1<M2,M2,"")),M2)
Q2: =IF(P2="",,IF(LEFT(P2,7)=LEFT(N2,7),MIN(ROUND((RIGHT(P2,LEN(N2)-8)-RIGHT(P2,LEN(P2)-8))*E2,3),F2),MIN(ROUND((1-RIGHT(P2,LEN(P2)-8))*E2,3),F2)))
R2: =MIN(MAX((LEFT(N2,4)-LEFT(P2,4))*12+MID(N2,6,2)-MID(P2,6,2)-1,0),ROUNDDOWN((F2-Q2)/E2,0))
S2: =R2*E2
T2: =IF(P2="",1,IF(LEFT(P2,7)=LEFT(N2,7),1-RIGHT(P2,LEN(P2)-8)-ROUND(Q2/E2,6),IF(Q2<(1-RIGHT(P2,LEN(P2)-8))*E2,1-RIGHT(P2,LEN(P2)-8)-ROUND(Q2/E2,6),IF((LEFT(P2,4)-LEFT(M2,4))*12+MID(P2,6,2)-MID(M2,6,2)+R2<J2,1-ROUND((F2-Q2-S2)/E2,6),MAX(K2,1-ROUND((F2-Q2-S2)/E2,6))))))
U2: =IF(P2="","",IF(LEFT(P2,7)=LEFT(N2,7),LEFT(P2,7)&"#"&(1-T2),IF(Q2<(1-RIGHT(P2,LEN(P2)-8))*E2,LEFT(P2,7)&"#"&(1-T2),IF((LEFT(P2,4)-LEFT(M2,4))*12+MID(P2,6,2)-MID(M2,6,2)+R2<J2,LEFT(P2,4)+INT((MID(P2,6,2)+R2)/12)&"#"&RIGHT("0"&MOD(MID(P2,6,2)+R2,12)+1,2)&"#"&(1-T2),LEFT(N2,7)&"#"&(1-T2)))))
V2: =IF(P2="",0,IF(LEFT(P2,7)=LEFT(N2,7),ROUND((1-T2)*E2,3),IF(Q2<(1-RIGHT(P2,LEN(P2)-8))*E2,0,ROUND((1-T2)*E2,3))))
W2: =IF(P2="",W1,U2)

BatchwiseExpireStock.xlsx
 
Upvote 0

Forum statistics

Threads
1,214,877
Messages
6,122,051
Members
449,064
Latest member
scottdog129

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