PLEASEEE SOME1 ANSWER THIS QUESTION!!!!

Sami

Board Regular
Joined
Mar 4, 2002
Messages
122
its the backbone of my project! Im doing a Stock control system. When a Sale is entered in the Sale workbook how do I get the sale quantity entered to subtract from the Stock quantity in the stock workbook automatically when its entered? i was thinkin something like Vlookuup n IF state ments!>????> :S
Thank you.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
On 2002-03-10 03:20, Sami wrote:
i was thinkin something like Vlookuup n IF state ments!>????> :S
Thank you.

Again, you were quite close.....

what you want your stock book to do is look at how many lots of product have been sold (and sum them together), so normally we'd use =sum

but in this case you need to differentiate between each type of product - ie you have a condition, which is where we'd normally use =if

Excel has a function called =sumif which combines the two

(I don't like your stock book layout as it doesn't leave any room for amounts of items actually sold, so I'm assuming you'd start with say 1000 in the total quantity column and then deduct automatic sales in this cell linked to your sales book)

the syntax for =sumif is as follows :

=sumif(types of items, specific item, quantity)

so as with the other example you solved, if your sales book has a named range where your productnames sit and another named range where your quantities sit and on your stock book you have a list of your products sitting under your product name column you should be able to do something like this (remember your filenames again though)

=sumif(salesbook.xls!productname,stockbook cell that contains your first product name, salesbook.xls!quantity)

be careful to keep your ranges in this formula the same size

this should give you the amount of sales for each, so deduct this from your starting quantities (say 1000) :

=1000-sumif(salesbook.xls!productname,stockbook cell that contains your first product name, salesbook.xls!value)

By the way, I'm not sure if anyone's told you but if you click on the button that says Fx you can browse all excels =functions and it takes you through them step by step... very helpful

Hope this gets you started (or finished)
Chris
This message was edited by Chris Davison on 2002-03-17 10:03
 
Upvote 0
hey thanks a lot. by the way my stock workbook doesnt start with 1000 it has a user form which you add to the certain stocks with. If i use sumif will this take away from the stock once or all the time? plz could u give a a hand with the code??!?!?
 
Upvote 0
sorry Sami, I have no idea what a userform is or what it does.

your first cell in quantity on your stock book.... what does it have in it ?
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,093
Members
448,944
Latest member
SarahSomethingExcel100

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