arraysexcelsumifs

Excel sum of multiple arrays


I have 2 tables (can be 100x100 table) in excel in the following sample format:

Table 1) shows consumption amount of certain food at certain age category

food consumption

Table 2) Number of persons at certain age category

Number of persons at certain age category

I want to find amount of each food type required each year based on number of persons without creating additional tables:

enter image description here

It is multiplication and summing array problem, but could not find solution for this problem using sum, sumproduct, or sumifs.. Does it exist?

The result should look like this:

enter image description here


Solution

  • Seems like MMULT with SUMIFS should do it:

    =MMULT(SUMIFS(C2:C6,A2:A6,TOROW(A12:A14),B2:B6,A18:A20),--B12:D14)
    

    mmult_sumifs.png