I am making a spreadsheet that keeps track of how many rolls of each film item I have in inventory everyday. Some film items can be used in the production of multiple products.
While I do have the formulas working correctly, I wonder if there is a way to shorten a certain formula that calculates how much of each film item is used on a day (excluding negative production values).
I have attached a Sample sheet. The part highlighted in yellow on Sheet!2 contains the formulas I want to simplify/shorten.
Basically, on Sheet!2 I have for example FilmItem123
K4:O4 = Name of products that use FilmItem123 (some are deliberately blank)
K5:O5 = Row of each product in Sheet!1
K6:O6 = Pieces of film used in each product
In Sheet!2 row 2, there are also Column#s where each date is located in Sheet!1.
In Sheet!1 I have SampleProduction named range giving how much of each product was made each day (product items are not sorted).
My formula breakdown is as follows:
INDEX using Row (product) and Column (date) to get production value for a product for that day.
Production value above is multiplied by that product's pieces quantity to get pieces of product made.
MAX used to replace any negative values with zero.
Each of the products' pieces values are summed together and then divided by pcs/roll for film item to get how many rolls of film were used for that day.
=SUM(MAX(0,INDEX(SampleProduction,$K5,E$2)*$K6),
MAX(0,INDEX(SampleProduction,$L5,E$2)*$L6),
MAX(0,INDEX(SampleProduction,$M5,E$2)*$M6),
MAX(0,INDEX(SampleProduction,$N5,E$2)*$N6),
MAX(0,INDEX(SampleProduction,$O5,E$2)*$O6))/$B4
My question is, is it possible to shorten the above formula? Some film items can have up to 10 or more products associated with them, and I have this feeling that the repeated pattern of the formula can be simplified even further.
I want it so that I can drag-copy the formula horizontally, as well as copy-paste into subsequent rows for different film items. Also, I would like to avoid using VBA or INDIRECT for something like this.
Thank you.
Sample.xlsx
Bookmarks