Calculate/display age of stock

User100

New Member
Joined
Feb 12, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi all!

Hope somebody can help me with this, see attached snap. I want to calculate how old the daily stock is. What I want in the line 'age of stock' is the total kilograms which are obsolete. In this example the product expires in 3 days, so consider what will be older than 3 days have to be thrown away and afterwards will be booked as manual correction if there is obsolete stock. From the stock in this example of Tuesday 25.01, after 3 days, so on Saturday 29.01 we have to throw away 2300 kg, this is filled in now manually. Is there an formula which can calculate this automatically and show me the obsolete stock after the expiration day?

I also want to see not only the obsolete stock after the expiration day, but maybe it is useful to see each day in how many days the stock will be produced, maybe this is easier than above solution, I am just try to figure out what the easiest way is.

If someone has a better idea to solve this in Excel please let me know, I am not very good in excel, still learning, so please explain and try explain me as beginner, many thanks and well appreciated!
 

Attachments

  • Capture age of products.PNG
    Capture age of products.PNG
    53.3 KB · Views: 66

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
can you give an example with the XL2BB-tool, because i have no idea how you calculate for example the stock.
I fear to need a VBA-solution, an UDF, is that a problem ?
 
Upvote 0
i have not worked out why its 2300 and NOT 2800
you could use a sumproduct to add up based on the header and the days

=SUMPRODUCT(($E$4:G14)*($E$1:G1=H1-$B$2))
if only want the sum of the header 3 days ago
OR
=SUMPRODUCT(($E$4:G14)*($E$1:G1<=H1-$B$2))
for anything older than 3 days

although i suspect this is a more complicated as you have 2300
so along with posting using XL2BB or on a share like dropbox/onedrive
with an explanation of how you get to the result with a few more examples

you may need as mentioned VBA _ not my area

Book1
ABCDEFGHIJKL
11/24/221/25/221/26/221/27/221/28/221/29/221/30/221/31/22
2Ep Days328002813281328132813
3grow1
4grow2600
5grow31
6grow4
7grow520005
8grow6
9grow7
10grow87
11grow9200
12grow10
13grow11
14grow12
Sheet1
Cell Formulas
RangeFormula
H2H2=SUMPRODUCT(($E$4:G14)*($E$1:G1=H1-$B$2))
I2:L2I2=SUMPRODUCT(($E$4:H14)*($E$1:H1<=I1-$B$2))
 
Upvote 0
Hi, Thanks for the feedback! I have problems to share the file, is there a website which I can share a link with, WeTransfer and Dropbox are not for free anymore it seems..
 
Upvote 0
dropbox basic is free for 2gb
onedrive free for 5gb
google drive
google docs
 
Upvote 0
i did something similar here, also obsolete stock, but had no reaction afterwards, can happen ...
Is a VBA-solution allowed ?
 
Upvote 0
A VBA-solution seems not to work properly if we share the file via sharepoint, can this be calculated without a VBA-solution?
 
Upvote 0
Example
Example age of product.xlsx
ABCDEFGHIJKLMNOPQRS
523/jan24/jan25/jan26/jan27/jan28/jan29/jan30/jan31/jan1/feb2/feb3/feb4/feb5/feb6/feb
6SundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySunday
7Product 1Total Production1.0001.0001.0002.0003.00040001.20014.0001.5001.6001.8002000
8Expiration in days3Stock6002.4008.30012.30011.3006.5001.6006001.700003.0001.2001.200200
90stock made day06002.4006.9005.0001.00050010001.700003.00002000
101stock made day-1001.4006.9005.0001.00050010000001.2000200
112stock made day-20004005.3005.0001.000500000001.0000
12expirated000002.3004.6001.0000000001.000
13Required00000000010.3009000000
14Age of stock0,000,000,170,631,381,691,561,830,00--0,001,001,671,00
15Manual correction-2300
16Grower 1Product specification600
17Grower 2Product specification600900
18Grower 3Product specification3000400200200
19Grower 4Product specification2000500600
20Grower 5Product specification20002000100
21Grower 6Product specification6006004000200
22Grower 7Product specification10001000
23Grower 8Product specification4000300
24Grower 9Product specification2001000
25Grower 10Product specification
26
272800690050001000500100023002000600460002000
Sheet1
Cell Formulas
RangeFormula
F5:S5F5=E5+1
F8:S8F8=SUM(F9:F11)
F9:S9F9=MAX(0,MIN(0,SUM(E9:E$11)-F$7)+F27)
F10:S10F10=MAX(0,SUM(E9:E$11)-F$7-F11-F12)
F11:S11F11=MAX(0,SUM(E10:E$11)-F$7-F12)
F12:S12F12=MAX(0,E11-F7)
F13:S13F13=MAX(0,F7-SUM(E9:E11)-F27)
E14:S14E14=IFERROR(SUMPRODUCT($B$9:$B$11,E9:E11)/SUM(E9:E11),"-")
F27:S27F27=SUM(F16:F25)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E13:L13Cell Value>0textNO
F14Cell Value>$D$7textNO
F14Cell Value>$D$7textNO
M14Cell Value>$D$7textNO
M14Cell Value>$D$7textNO
M13:S13Cell Value>0textNO
 
Upvote 0
Thanks, for helping, stock of each days should be older if you look at the production per day and stock level per day. Is the age of stock displayed in days?

The Expirated formula looks good, is it possible to make 1 formula for this without adding extra rows?
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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