You have one major problem in your design that causes your formulas to be overly complicated, as can be seen in the error pointed out by event21. Please see the attachment below for a redesign of your data layout.
Prices for individual ingredients were in column B. I have moved them to be in row 2, in parallel with the ingredient names. This makes it much easier if you have to change ingredients or prices. This allows your formula in column G to be much simpler, as you can see. I suggest you review Excel Help for the SUMPRODUCT function that I used to simplify this formula.
Your formula in column O used the same formula as column F. Instead of repeating the entire formula, it now simply refers to the value already calculated in column F.
It appears that column N (now L in my design) is entered manually to refer to the corresponding stock from which the prepared product is made. This is error prone. To make it easier for the user, I have added a column to select the stock from a dropdown, and the price for the stock is looked up automatically. This depends on two Excel techniques that you might not be familiar with:
1. Data validation. Excel allows you to specify rules for what data is allowed to be in a cell. One type of rule is called the Validation List. To use this, you specify a range of cells that contain that allowed values. There is a Dropdown option, which shows those allowed values in a dropdown list, easy for the user to select.
2. Dynamic named range. A named range in Excel is way of giving a name to a range of cells. This has several benefits that I won't get into right now, but an example of how this works is that if you have a formula like this
=SUM($A$1:$B$20)
you can assign a name, let's say MyData, to the range $A$1:$B$20. Then the formula can be written as
=SUM(MyData)
A more complex type of named range includes the count of how many cells are actually being used in the range. I used the following formula and named it ProductStockList
This looks scary but in English it says this:
"Start from cell A4. Count how many non-blank cells are in A4:A41, and go that many cells down from A4."
To get this to work properly I had to remove the x's in column C that didn't appear to have any meaning.
There are a few other things I would clean up but I didn't want to throw too much at you at once. And I would really suggest that you don't write your posts as one long sentence.
Bookmarks