Question

Is it possible using Excel's sumifs to find the sum of elements of a matrix using condition on row and column? For example matrix:

    c   d   e
a   1   2   3
b   4   5   6

I would like to sum elements of b row, d and e columns. The solution should work also for large dimension matrix. Sorry for ugly formatting.

Was it helpful?

Solution

Maybe this formula could be extended to your needs: (data in A1:D3)

=SUMPRODUCT(--ISNUMBER(MATCH(B1:D1,{"d","e"},0)*MATCH(A2:A3,{"b"},0)),B2:D3)

OTHER TIPS

Along similar lines, you can try:

=SUM(((B1:D1="d")+(B1:D1="e"))*(A2:A3="b")*B2:D3)

which uses the idea that with respect to the arithmetic operations, TRUE is 1 and FALSE is 0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top