Kurt UXD
Kurt UXD

Reputation: 5796

Google sheet: SUMIF with relative (not fixed) sum range?

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?

enter image description here

Upvotes: 0

Views: 177

Answers (1)

MattKing
MattKing

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

Related Questions