if function

lqorri

New Member
Joined
Feb 13, 2017
Messages
14
Hello- i have an excess inventory on hand which i need to figure out which part to keep and which part to destroy.

my goal is to get a formula that will give me the desired output for the column in red font (destroy the rest). I have done a few scenarios to hopefully explain this better. As you can see i am adding (current on hand + last years inventory shipment)-keep 5 years of inventory on hand.

Thank you in advance.




[TABLE="width: 830"]
<tbody>[TR]
[TD][TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Scenario[/TD]
[TD]Current on hand inventory[/TD]
[TD]Last year's inventory shipment[/TD]
[TD]2 year average sales[/TD]
[TD]keep 5 years of inventory on hand (based on sales)[/TD]
[TD]Destroy the rest[/TD]
[/TR]
[TR]
[TD]#1[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]10[/TD]
[TD]50[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]#2[/TD]
[TD]20[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]10[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]#3[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]10[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]#4[/TD]
[TD]0[/TD]
[TD]15[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]#5[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

Would this work for you:


Book1
ABCDEF
1ScenarioCurrent on hand inventoryLast year's inventory shipment2 year average saleskeep 5 years of inventory on hand (based on sales)Destroy the rest
2#15010500
3#220521015
4#31002100
5#40151510
6#510100020
Sheet561
Cell Formulas
RangeFormula
F2=MAX(B2+C2-E2,0)


Formula copied down.
 
Upvote 0
Assuming that your data starts in cell A2, then in cell E2 put the following formula

=IF((A2+B2)-D2<0,0,(A2+B2)-D2)

Copy down
 
Upvote 0
Hi,

thank you both for the reply. I apologize in advance as i was not clear. The goal is, i need to figure out how much inventory to destroy from the current on hand inventory. Last year shipment is used for a forecasting standpoint. I can not physically destroy that inventory, however i need to take into account as we can still use. i have added scenario 6 to hopefully help visualize. the amount to destroy would be 100 since we already have enough inventory from last years shipment to fulfill the threshold of 5 years of inventory on hand.



[TABLE="class: cke_show_border"]
<tbody>[TR]
[TD][/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]Scenario[/TD]
[TD]Current on hand inventory[/TD]
[TD]Last year's inventory shipment[/TD]
[TD]2 year average sales[/TD]
[TD]keep 5 years of inventory on hand (based on sales)[/TD]
[TD]Destroy the rest[/TD]
[/TR]
[TR]
[TD]#1[/TD]
[TD]5[/TD]
[TD]0[/TD]
[TD]10[/TD]
[TD]50[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]#2[/TD]
[TD]20[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]10[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]#3[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]10[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]#4[/TD]
[TD]0[/TD]
[TD]15[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]#5[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]#6[/TD]
[TD]100[/TD]
[TD]100[/TD]
[TD]10[/TD]
[TD]50[/TD]
[TD]100[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I'm unclear of your requirements...

According to your New description in Post # 4, then wouldn't the answer be 10 for Scenario #5 , and 0 for Secnario #4 ?
 
Upvote 0
Can't read your latest post, but if my assumption is correct in Post # 5, then use this:


Book1
ABCDEF
1ScenarioCurrent on hand inventoryLast year's inventory shipment2 year average saleskeep 5 years of inventory on hand (based on sales)Destroy the rest
2#15010500
3#220521015
4#31002100
5#4015150
6#510100010
7#61001001050100
Sheet561
Cell Formulas
RangeFormula
F2=MIN(MAX(B2+C2-E2,0),B2)


Formula copied down.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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