In my use-case, when I use INDEX-MATCH I get an array. The array corresponds to some keys in another sheet where the column A are the keys and the next column B are the values. How do I use the returned array of keys and look them up in the other sheet, get the corresponding value, and sum the values?
To make this more concrete:
I have three sheets, weights, bags, and totals.
weights
has items in column A and their corresponding weight in column B.
bags
has each row with the column A as the bag name and all other columns as items in each bag. the items are from weghts!A1:A
totals
has column A as the name of the bag from bags
sheet. The second column should be the total weight of all items inside that bag.
The items themselves can be found in the bags
sheet using the formula
INDEX(bags!B:Z, MATCH(A1, bags!A1:A))
How do I use this array of results to find their weights in weights
and sum them up? I would like to not need to modify the structure of the sheets.