Reputation: 5796
I have my data organised in a NxN table with coupled columns {quantity,code} (see image below).
I'm looking for a function able to calculate total quantity by code.
I've tried with SUMIF, but it seems to work only with a fixed sum range, whilst I need a RELATIVE sum range.
Can you address me to the right solution?
Upvotes: 0
Views: 177
Reputation: 7773
i think this should work:
=ARRAYFORMULA(SUM(A2:G4*(B2:H4=A7)*(A1:G1="quantity")))
just using multiplication of booleans to get at the correct values is sometimes simpler.
Upvotes: 2