Prevent Negative Inventory

Peter888

New Member
Joined
Aug 15, 2017
Messages
16
As Title said, I have 3 Column Which is Inventory A1, Sales B1, Final Stock C1. I want to make Data Validation to prevent user from entering Sales Value that exceeds my final stock value and resulting negative final stock value. Is there any simple formula for it. I want this to applies to whole final stock column. Thank you in advance
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Please post a sample of your data so we can see what your data structure looks like.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
As Title said, I have 3 Column Which is Inventory A1, Sales B1, Final Stock C1. I want to make Data Validation to prevent user from entering Sales Value that exceeds my inventory stock and resulting negative final stock value. Is there any simple formula for it. I want this to applies to whole final stock column. Thank you in advance

Hello Sorry for not posting the data sample earlier. What i want is to prevent cell Total Inventory Column from being negative (As you can see Total Inventory of Apple were -3 on cell G6). I want a data validation formula that gives Error Message whenever a user trying to input sales value that exceed Last Total Inventory Value. Example, Apples beginning stock were 10. Theres Apple Sales on 1 January and 10 January which were 2 and 1 respectively. But on 13 January, the user input Apple Sales with 10 Value while we only have 7 Apples left in our inventory. How do i prevent user to input value more than our last inventory value?)

Book1
CDEFG
5NameBeginning InventorySalesTotal Inventory
6Apple1013-3
7Orange826
8Grape642
9
10Sales
11DateNameQTY
1201-JanApple2
1303-JanOrange2
1410-JanApple1
1512-JanGrape4
1613-JanApple10
Sheet1
Cell Formulas
RangeFormula
F6:F8F6=SUMIF($D$12:$D$27,D6,$E$12:$E$27)
G6:G8G6=E6-F6
 
Upvote 0
I am not sure how to do it with Data Validation, but I can think of a way to do it using VBA (it will be automated VBA code that will run automatically upon cell entry).
Is that an acceptable solution?
You do not need to know anything about VBA to use it - it will be a "plug-and-play" solution.
 
Upvote 0
How about
+Fluff 1.xlsm
CDEFG
5NameBeginning InventorySalesTotal Inventory
6Apple10100
7Orange826
8Grape642
9
10Sales
11DateNameQTY
1201/01/2021Apple2
1303/01/2021Orange2
1410/01/2021Apple1
1512/01/2021Grape4
1613/01/2021Apple7
Lists
Cell Formulas
RangeFormula
F6:F8F6=SUMIF($D$12:$D$27,D6,$E$12:$E$27)
G6:G8G6=E6-F6
Cells with Data Validation
CellAllowCriteria
D12:D16List=$D$6:$D$8
E12:E16Whole numberbetween 1 and SUMIFS($E$6:$E$8,$D$6:$D$8,D12)-SUMIFS(E$11:E11,D$11:D11,D12)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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