Example Google Sheet - Grocery Store.
On the sheet 'Stock' there are the items for sale (column Name) and the quantity for each item (column Quantity).
On the sheet 'Sales' the name of the item sold will be selected from a dropdown list and the number of items sold should be entered manually.
What needs to be done:
Create a Google Sheets function =SELL(n)
, where n = number of items sold. The function should have the following properties:
a) checkName
- check the cell to the left for the item name and find in in 'Stock' tab, for example 'Apples'
b) decreaseQty
- Decrease Quantity in 'Stock' by the number of items sold. For example, if we had 10 Apples in Stock and sold 1, there should be 9 left.
b) increaseSold
- Increase Sold items in 'Stock' by the number of items sold. For example, if we had 5 Apples sold and sold 1 more, there should be 6.
c) (Optional step). Nr. of items sold greater than Quantity in 'Stock' should not be allowed.
Your help would be greatly appreciated.